[comp.windows.misc] Color maps....

dwy47@unix.cis.pitt.edu (Deanna W Yang) (03/28/91)

Hi there.   I am very new to the world of X programming so pardon me
if I sound stupid or that I didn't read the books thorough enough...


In my application, I need to allocate colorcells for 16 application 
defined colors (let's say I put them in appcolor[0]..appcolor[15]).   Now
I can use the colors (if I want blue, it gives me blue) just as I define
them (RGB values).  The problem is,  when I need to do  logics with the
colors, like xoring, anding etc (e.g. white on blue gives yellow..etc),
since I am not using the default colorcells, I can't get the correct 
color for the modes.   Say if I draw boxes using the Xor mode,  it won't
give me the correct color.    It's not as simple as  blue (0001) on 
white (1111)  xor gives  yellow  (1110) because there's no way to know
what color cells are allocated (or is there?) and even if we know, there's
no systemetic scheme to do the logics.    

Are there anyone (you guru's :-) ) out there who have the idea or the 
algorithm to solve my problem?    I don't know if I explain the question
well enough but I do need the help.


In a nutshell....if XAllocateColorCells give back like 97, 98, 99...  (they
might not even be contiguous),  what algorithm i can use to acheive the
correct logics?   Note that the allocated cells can be anything....

Thanks.....I need your help.

Deanna

dwy47@unix.cis.pitt.edu (Deanna W Yang) (03/28/91)

Forgot to say....please reply through email please.   Thank you.  :-)

D