> > On 27.10.2010, at 19:07, Greg Ercolano wrote: > > > Uwe Duerr wrote: > >> The solution I came up with was to use = > fl_color_average(color,FL_WHITE,0.35); > >> to set the textbackground in the Fl_Select_Browser. Now colors are = > similar. > >> Not a good solution, but it works at least. > >> Just in case you have the same problem. > >=20 > > Cool, glad you figured it out. > >=20 > > We should maybe have a method in FLTK that does something like = > this, > > where it returns the color /unless/ it's plastic, in which case = > it > > returns something like your solution above. > > You can find the function that calculates the background color here: > > src/fl_plastic.cxx > > Fl_Color shade_color(uchar gc, Fl_Color bc) > > Isn't OpenSource great? ;-)= > Sure it is. And FLTK is great too.
I did locate this module very fast, after my post wasn't answered quickly, so I thought my question seems not to be easily answered and I started digging. I have checked and patched this module to make the shade color available but, this is not as easy as it looks it is. The gc argument is a character which gets used as an index into ramp arrays. Higher level functions provide a string of characters to apply shading. I tried with several characters (as they are used in fl_plastic.cxx) but the result was not as expected. I did not dig deeper to understand what is going on there, so the use of fl_color_average, which I discovered in Enumeration.h, does it for me. Probably it would be nice to have an interface to inquire the solid color used, based on the scheme selected. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

