Hi,

On Nov 5, 2012, at 12:31 PM, Matthias Melcher <[email protected]> wrote:

> 
> On 05.11.2012, at 20:58, Laszlo Antal <[email protected]> wrote:
> 
>> Hi,
>> 
>> On Nov 5, 2012, at 9:06, Doug Parks <[email protected]> wrote:
>> 
>>>> Is it possible to compare the color of a widget in an "if" statement?  If 
>>>> so how would I go about doing it.  I have tried using a standard 
>>>> comparison but it says it is unable to do it.
>>>> 
>>>> Thanks
>>>> Doug
>>> 
>>> 
>>> I figured it out.  Sorry for the inconvenience.
>> 
>> And your solution is?
> 
> Colors are unsigned int's (32 bit). The components are encoded RGBI where I 
> is an index, or , if that is 0, RGB are 8bit color components. To get the RGB 
> value from any color, use:
> 
> 
> static void   Fl::get_color (Fl_Color i, uchar &red, uchar &green, uchar 
> &blue)
>       Returns the RGB value(s) for the given FLTK color index. 
> 
> and compare components

Oh nice, I actually was hoping fltk would have a method for that.
Thank you!

Laszlo
http://twitter.com/LZAntal

> _______________________________________________
> fltk mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to