FLTK logo

Re: [fltk.general] Default text color for all widgets

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Default text color for all widgets Greg Ercolano Jul 20, 2021  
 


On 7/18/21 1:30 PM, Webb Hinton wrote:
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.


--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/578c3984-5b60-a813-c6f1-19e9dc4ddf6e%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.