On Jan 28, 2008, at 8:32 AM, [EMAIL PROTECTED] wrote:

Date: Mon, 28 Jan 2008 04:30:21 -0800 (PST)
From: Hamish <[EMAIL PROTECTED]>
Subject: [GRASS-dev] lib fn to convert int color number to RGB values?
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=iso-8859-1

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

We have such functions in both the TclTk and wxPython GUI's if that is any help.

Michael

_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to