News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
feedback please
Author Message
jpjacobs
Member
***


Posts: 113
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
RE: feedback please

The FLTK documentation says:

Quote:
void set_color(Fl_Color, uchar, uchar, uchar);
void set_color(Fl_Color, unsigned);

Sets an entry in the fl_color index table. You can set it to any 8-bit RGB color. The color is not allocated until fl_color(i) is used.


That might explain that you don't see a change directly

For the getcolor thing: the FLTK docs give 2 possible uses of getcolor: one with 1 argument, one with 4.
The one argument version simply returns 1 value (the Fl_Color, which in fact is 0xRRGGBBII where RR,GG,BB are the RGB values, and II is the index of the color in the palette).
The 3 last arguments of the 4 argument version are references to variables where the function will leave the RGB values, at least that's in C++. If I'm interpreting the fltk binding code correctly, in Lua it just returns the RGB components, and the 4 argument thing is just for signalling we want the seperate components too. As such, it's just an artifact of a limitation in C++ that doesn't exist in Lua, so I think it wouldn't be bad to simply always return everything (so Fl_Color, R,G,B). More generally it wouldn't be a bad idea to look for other functions which have references (or whatever the &var is), I think lots of times they are used for emulating a multi-value return.

So putting it shortly: merge these functions to one, returning the Fl_color and 3 components, without requiring the 4 arguments.

Greetings,

Jan-Pieter

12-06-2010 10:05 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
feedback please - mikshaw - 06-29-2009, 11:51 AM
RE: feedback please - mikshaw - 06-30-2009, 01:13 AM
RE: feedback please - jpjacobs - 06-30-2009, 06:01 AM
RE: feedback please - mikshaw - 06-30-2009, 12:28 PM
RE: feedback please - jpjacobs - 07-01-2009, 04:21 AM
RE: feedback please - MrBill - 07-02-2009, 03:34 AM
RE: feedback please - mikshaw - 07-02-2009, 12:33 PM
RE: feedback please - jpjacobs - 11-29-2010, 10:08 PM
RE: feedback please - mikshaw - 11-30-2010, 01:55 PM
RE: feedback please - JohnMurga - 12-06-2010, 07:05 AM
RE: feedback please - mikshaw - 12-06-2010, 08:08 AM
RE: feedback please - jpjacobs - 12-06-2010 10:05 AM
RE: feedback please - mikshaw - 12-07-2010, 01:37 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: