Hi Håvard
I handle a "dark" mode feature using the following code:
// Set foreground and background colours
if (DARK) {
Fl::foreground(240, 240, 240); // 15/16 White
Fl::background2(16, 16, 16); // 1/16 white
Fl::background(32, 32, 32); // 1/8 white
}
else {
Fl::foreground(16, 16, 16); // 1/16 white
Fl::background2(240, 240, 240); // 15/16 white
Fl::background(192, 192, 192); // 3/4 white
}
That I call before I instantiate any widgets, as it's invoked by a command line switch. This changes the colours represented by FL_FOREGROUND_COLOR etc. The non-DARK colours are the default 1.4 colours, the DARK set was achieved by a bit of trial and error
to get the grey level right for FL_BACKGROUND_COLOR.
I use the default colours for most widgets and this allows them to be either light foreground on dark background or the other way round.
If (and it's a big if) the colours used by a widgets are kept as FL_FOREGROUND_COLOR then changing this dynamically may do what you want by just calling redraw() on your top window to switch colours without having to go round all the widgets in turn changing
their colours.
Regards Phil.