Re: gdk color values



On Sat, 27 Jun 2003, Rajarshi Guha wrote:

color.red = rvalue * 65535 / 255

Here's a quicker way:  rvalue * 256 + rvalue (divisions are slow).

Do this for all three color channels.

However the colors in the drawing area that is drawn into with the
resultant GdkColor dont match what I see from the color selection

How so?

dialog. The docs say that the range from 0-65535 indicates that
intensity is present - does this mean that getting rid of the intensity
portion of a color I would get the 'plain' color - I dont know if this
makes sense, but if this is the way to go how do I get rid of intensity?

If you set the red component to 0 then there will not be any red in the
combined color.  If you set it to 65535 you will get the maximum possible
amount of red in the combined color.  If the blue component was 0
and the red and green components were the same you would get a yellow
color.  Standard additive color theory.

-Peter

"... in 1278 they imprisoned him on the charge of "suspected novelties" in
his teaching."



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]