Seems like if we have methods for setting the global text size +
global font, that there should also be a way to set the global
text color?
I suppose if there were a 'global color', before calling the
draw() of each widget,
fltk could reset the current color to that value so that the
color always starts at
some default.
When developing an app with a dark theme it can quickly
become tedious to have to manually set the label color for each
and every one of our widget classes.
Normally to do this you'd change the color map so that the new
colors affect
all widgets. See my replies in
this thread from 2020. where I show how to make
a dark theme this way. Please note there's two replies from me
in that thread;
the first describes the technique, the second shows some code
showing how to
redefine the color ramp commonly used for widget colors, and a
file format
allowing you to have different text files define different
colormaps that can
be loaded by the user while the app is running to choose
different theme colors.
Basically you get results like the below without having to
customize widgets.
Just make sure your widgets use predictable color map colors,
preferably
colors that are in the color ramp between colormap colors #32
and #56.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.