Joined: July 2004
||Posted: Feb. 07 2007,20:33
FINALLY got it =o)
I think i must have spent at least 3 or 4 hours in total digging through the FLTK and murgaLua docs and source files, and trying syntax variations. I knew it was supported in murga because get_color is in the murga bindings, it came down to two things I overlooked:
1) "get_color" is under the "Fl" class rather than in the fl_* functions, so the syntax to call it is Fl:get_color rather than fltk:get_color
2) In order to get separate rgb values, the function needs not only to be set to 3 variables, but also needs three variables as arguments...i guess like pointers in C?
Anyway, here's what I'm using to get and set a button color:
|Code Sample |
if c_ok == 1 then
The fl_color_cube function does an approximation of the RGB values in order to use one of the 256 colors in the fltk colormap. This means that you could set the button to a particular color, and then if you click the button again the RGB values shown will usually be a little different, causing a color shift.
It's good enough for my current script, but I'll look into something better later...probably use set_color instead of fl_color_cube.