On 4/22/26 11:44 Michele Alessandrini wrote:
> Ok I digged a little bit more and found the function
> get_system_colors() that's OS-specific and changes some of the colors.
> It's called in Fl_Window::show(), so I was checking the color's value
> too early in the main(). Now I see that on Windows it's changed to
> #F0F0F0 (that may depends on my Windows configuration maybe).
> How was #C0C0C0 chosen as a default on X11? I find it a little bit too
> dark...
I can't tell why this particular value was chosen, but I see that this
value has been in the code at least since 2003, maybe even earlier. It's
likely that this was a typical background color on Unix (or maybe
already on Linux) systems. Many features (colors, themes) were based on
SGI systems, AFAICT.
> What if I call Fl::background() and change it to something else? When
> should I call it to not being changed back from get_system_colors()?
Please see Manolo's reply on this.
I'd like to add that you can use the commandline switch " -bg
'#rrggbb00' " on Linux to test the background color (r/g/b) you like
best w/o having to change the source code - i.e. before you finalize
your code. Note the single quotes and the trailing 00, but remove the
double quotes.
In my opinion, however, it's not good practice to hardcode things like
the background color. Users should have the option to set the color
themselves (e.g., via preferences).