How to handle user selectable colors in dark mode?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Dummy
Earned some good credits
Earned some good credits
Posts: 121
Joined: Tue May 10, 2005 10:29 am

How to handle user selectable colors in dark mode?

Post by Dummy »

Hello everyone!

What would be the right way to deal with user selectable colors in an application (e.g. a text editor) that:
  • Allows the user to select font colors.
  • Displays the document text on the screen with background depending on system theme (light or dark theme).
  • Allows the user to print the document (on paper).
Everything is clear in light mode.
The color selected by the user is displayed on the screen as well as printed on the (white) paper.

But what to do in dark mode?
The color that the user selects via wxColourPickerCtrl cannot be used for both, displaying on screen (on a dark background) and printing on (white) paper!?

Is there any support from wxWidgets (using GTK on Linux) for such a requirement?

Thanks for every hint how something like that would be done in general and specifically with wxWidgets.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to handle user selectable colors in dark mode?

Post by ONEEYEMAN »

Hi,
Most likely the user will have to select a new set of colors because the text might become unreadable.
Now aht control are you talking about - wxTextControl, wxRTC or wxSTC? Or you paint the text yourself?
And what version of wxWidgets and GTK+ do you use?

Thank you.
Dummy
Earned some good credits
Earned some good credits
Posts: 121
Joined: Tue May 10, 2005 10:29 am

Re: How to handle user selectable colors in dark mode?

Post by Dummy »

Thanks for your reply.

Does it really make a difference which control I use?
I draw it myself using wxDC. I am using wxWidgets-3.1.4 with GTK2, but will also try GTK3.

It is not clear to me how it should be done in principle.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to handle user selectable colors in dark mode?

Post by ONEEYEMAN »

Hi,
Yes, it does makes a difference.
wxTextCtrl is a native control under all platforms, therefore system/toolkit should handle the colors itself. However, I'm not sure GTK2 is capable in supporting the "Dark Mode".

wxRTC is a generic control, which means everything is done by the library and so wxWidgets developers could have more control over this.

wxSTC is 3rd party external library wrapped into the wxWIdgets API. And so theming support is strongly depends on STC devs.

Now when you said you are painting the text - it means you have full control text representation on screen.

Also - why do you say that the colors will not be useful for printing in "Dark Mode"? If the user think that they are wrong - he can change them - there is a print dialog.
Or (s)he can choose another colors.

Thank you
Post Reply