[GRASS-dev] lib fn to convert int color number to RGB values?

Hamish hamish_b at yahoo.com
Mon Jan 28 07:30:21 EST 2008


Hi,

I am looking for a library function to get the R,G,B values (0-255) for
an integer color number which was created with D_parse_color(). I don't
want to set the color for drawing, just get the RGB component values so
I can populate a RGBA_Color struct. Reparsing the original color string
isn't an option without a lot of re-fn prototyping as I'm operating in
a subordinate function with only the int color number available.

I've searched through the color functions in the display, raster, and
gis libraries without much luck. The closest I found was
D_raster_use_color().

any ideas?

Is a new D_number_to_RGB(int color, unsigned char &r,&g,&b) fn needed
in lib/display/tran_colr.c? Or some place better?


thanks,
Hamish



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the grass-dev mailing list