Bug 114147 - Better support for DE themes to support Night mode/Inverted colors in the LO GUI
Summary: Better support for DE themes to support Night mode/Inverted colors in the LO GUI
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2017-11-29 16:46 UTC by Denis
Modified: 2017-12-04 08:26 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis 2017-11-29 16:46:15 UTC
It would be nice if LibreOffice had some kind of "night mode" that when turned on would draw the picture of the opened documents with inverted colors, so they would have a dark background with light text on it.

I know about tools that reduce screen brightness on schedule, but that's not it. I (and many other people) use dark interface theme, dark theme for my text editor and a global dark style for Firefox (that makes all sites have dark background with light text). After that, switching to a document with white background really hurts my eyes.

So I was thinking, qpdfview has a hot key that inverts colors for the opened documents, maybe the same could be implemented in LibreOffice?

Manually and permanently assigning background and font colors for the document is not a solution because you would have to change them back and forth when you work on the document with someone else. Besides if the document has some paragraphs in different colors, manually changing it all would be a hassle.

So, something like a filter that applies a CSS that inverts colors in the document (only visually, without changing the document). Even better if it would invert colors for the text and tables and significantly reduce the brightness of graphical elements (like images and diagrams) until they receive mouseover event.

But the latter is probably complicated, and I understand if no one would want to get involved in this. The first suggestion (total inversion of colors), on the other hand, sounds like something pretty basic since it does not involve any logic behind it. And it still would do wonders for the eyes, I know it from my experience with the aforementioned qpdfview.
Comment 1 Adolfo Jayme Barrientos 2017-11-29 21:00:54 UTC
IMHO this is a function that belongs to the operating system instead of a particular application.

Compiz allows me to invert the colors of any windows with Super+N/M.
Windows 10 1709 lets me invert the screen colors (or even add color blindness filters) by pressing Win+Ctrl+C.

So KWin should do something similar if it doesn’t.
Comment 2 Denis 2017-11-30 03:31:48 UTC
Inverting the colors in the window with a window manager or compositor would invert the colors of GUI too, and as I have already said, I use a dark theme, so that would make my GUI elements bright.
Comment 3 Regina Henschel 2017-11-30 13:21:11 UTC
You can go to Tools > Options > LibreOffice > Application Colors. There you can set application and document color and others. And you can save this setting to a new scheme, so that you can easily switch between the regular LibreOffice scheme and your own one.
Comment 4 Buovjaga 2017-12-02 19:56:28 UTC
(In reply to Regina Henschel from comment #3)
> You can go to Tools > Options > LibreOffice > Application Colors. There you
> can set application and document color and others. And you can save this
> setting to a new scheme, so that you can easily switch between the regular
> LibreOffice scheme and your own one.

Denis: are you happy with this?
Comment 5 Denis 2017-12-02 20:43:00 UTC
(In reply to Buovjaga from comment #4)
> (In reply to Regina Henschel from comment #3)
> > You can go to Tools > Options > LibreOffice > Application Colors. There you
> > can set application and document color and others. And you can save this
> > setting to a new scheme, so that you can easily switch between the regular
> > LibreOffice scheme and your own one.
> 
> Denis: are you happy with this?

A custom theme can deal only with standard colors: general background of the document, general font color, link font color/background, etc. It can't do anything with the text/background that has been changed manually, so this solution doesn't take into account that often you have to work on one document with someone else.

Say you created such a custom theme, where default background is black or dark gray and default font color is white or light gray. You may have even changed some (or all) other available colors: visited/unvisited links, breaks and so on. But you can't do anything via this theme with colors that someone has just changed manually.

For instance a colleague has sent you a file where he decided to change the font color for some passage to dark blue. For him it is clearly visible on the standard white background. For you it is almost indiscernible against the dark custom background, because the theme could not change the manually colored font but changed the standard white background.

The same with the background. This example is taken straight out of practice: in our office people, when they send a document to you, like to highlight some passages that require your attention with light-yellow background, leaving the default (i.e. black) text color. For them it looks okay: the black text is clearly visible against the yellow background, and the background is clearly not white, so it can be seen that it is highlighted. But with such a custom theme it would be a passage with yellow color and indiscernible white or light-gray text.

That is why I was hoping for a filter that would just invert all colors within a document, like in qpdf. I hope I do not sound like I think someone owes it to me to do it, I was just hoping that it was not difficult to implement and someone would find it worth their time.
Comment 6 V Stuart Foote 2017-12-02 22:52:45 UTC
LibreOffice already will pick up the colors from OS DE theme. It just has to be forced to do so.

On Windows for example, forcing it to do so is done from the Tools -> Options -> Accessibility panel where the "Options for High Contrast Appearance" are located.

Select the "Use automatic font color for screen display", and "Automatically detect high contrast mode of operating systems" checkboxes.

For now, this is not a 100% solution as our fixed "high contrast" icons is an incomplete Galaxy/Elementary derivative only suitable for dark HC themes.

Believe tweaking this mode to allow selection of other icons sets (i.e. Sifr Light, or Sifr Dark) but also to apply without requiring the OS DE theme signal for HC should should provide a full DE theme driven GUI within LO _without_ changing the application colors from default "automatic" settings.
Comment 7 Denis 2017-12-03 05:35:10 UTC
(In reply to V Stuart Foote from comment #6)
> LibreOffice already will pick up the colors from OS DE theme. It just has to
> be forced to do so.
> 
> On Windows for example, forcing it to do so is done from the Tools ->
> Options -> Accessibility panel where the "Options for High Contrast
> Appearance" are located.
> 
> Select the "Use automatic font color for screen display", and "Automatically
> detect high contrast mode of operating systems" checkboxes.
> 
> For now, this is not a 100% solution as our fixed "high contrast" icons is
> an incomplete Galaxy/Elementary derivative only suitable for dark HC themes.
> 
> Believe tweaking this mode to allow selection of other icons sets (i.e. Sifr
> Light, or Sifr Dark) but also to apply without requiring the OS DE theme
> signal for HC should should provide a full DE theme driven GUI within LO
> _without_ changing the application colors from default "automatic" settings.

You are talking about GUI. On my system LO already uses general (dark) OS DE theme, as I have said in my opening message. I am talking about the document colors: the document takes the most of the screen anyway and thus, the colors in the document influence your eyes much more. What was discussed in the previous two comments was using a custom theme for document repesentation.
Comment 8 V Stuart Foote 2017-12-03 15:50:14 UTC
(In reply to Denis from comment #7)
> 
> You are talking about GUI. On my system LO already uses general (dark) OS DE
> theme, as I have said in my opening message. I am talking about the document
> colors: the document takes the most of the screen anyway and thus, the
> colors in the document influence your eyes much more. What was discussed in
> the previous two comments was using a custom theme for document
> repesentation.

What you request in OP is:

"So, something like a filter that applies a CSS that inverts colors in the document (only visually, without changing the document). Even better if it would invert colors for the text and tables and significantly reduce the brightness of graphical elements (like images and diagrams) until they receive mouseover event."

Arbitrarily inverting colors would not solve the general case. In fact LO already is capable of setting a visual theme for the document based on colors from the OS DE theme. But for bug 35365 [1] it was hard coded to COL_WHITE for DOCCOLOR and COL_BLACK for FONTCOLOR--regardless of DE theme in use.

But that broke HC mode use for a11y, so in bug 71511 [2] LO now picks it up from the Accessibility configuration for HC (even if the OS DE is not flagged HC) and uses GetWindowColor() for DOCCOLOR and GetWindowTextColor() for FONTCOLOR under OS DE theme control.

What is still needed is support of Dark themes for non-a11y use not bound to HC mode of the OS DE (as noted by Bjoern in bug 71511 #11), to support dark theme use. Those colors could be pulled from the OS DE theme, or could also have a different fixed color assigned. It would likely require another Tools -> Options -> View check box control.

Point is those colors would either be drawn from OS DE theme, or would be generally fixed to support "dark" themes, but not be a simple reversal of the COL_BLACK & COL_WHITE now used.

=-ref-=
[1] https://gerrit.libreoffice.org/#/c/238/

[2] https://gerrit.libreoffice.org/#/c/7484/
Comment 9 Denis 2017-12-03 16:59:03 UTC
(In reply to V Stuart Foote from comment #8)
> (In reply to Denis from comment #7)
> > 
> > You are talking about GUI. On my system LO already uses general (dark) OS DE
> > theme, as I have said in my opening message. I am talking about the document
> > colors: the document takes the most of the screen anyway and thus, the
> > colors in the document influence your eyes much more. What was discussed in
> > the previous two comments was using a custom theme for document
> > repesentation.
> 
> What you request in OP is:
> 
> "So, something like a filter that applies a CSS that inverts colors in the
> document (only visually, without changing the document). Even better if it
> would invert colors for the text and tables and significantly reduce the
> brightness of graphical elements (like images and diagrams) until they
> receive mouseover event."
> 
> Arbitrarily inverting colors would not solve the general case. In fact LO
> already is capable of setting a visual theme for the document based on
> colors from the OS DE theme. But for bug 35365 [1] it was hard coded to
> COL_WHITE for DOCCOLOR and COL_BLACK for FONTCOLOR--regardless of DE theme
> in use.
> 
> But that broke HC mode use for a11y, so in bug 71511 [2] LO now picks it up
> from the Accessibility configuration for HC (even if the OS DE is not
> flagged HC) and uses GetWindowColor() for DOCCOLOR and GetWindowTextColor()
> for FONTCOLOR under OS DE theme control.
> 
> What is still needed is support of Dark themes for non-a11y use not bound to
> HC mode of the OS DE (as noted by Bjoern in bug 71511 #11), to support dark
> theme use. Those colors could be pulled from the OS DE theme, or could also
> have a different fixed color assigned. It would likely require another Tools
> -> Options -> View check box control.
> 
> Point is those colors would either be drawn from OS DE theme, or would be
> generally fixed to support "dark" themes, but not be a simple reversal of
> the COL_BLACK & COL_WHITE now used.
> 
> =-ref-=
> [1] https://gerrit.libreoffice.org/#/c/238/
> 
> [2] https://gerrit.libreoffice.org/#/c/7484/

If what is currently discussed, with picking up DE theme and auto adjusting accessibility options is solving someone's problems, that's fine - but it has nothing to do with my original request (the name of which was different).

There were 2 main points: inverting all colors (ALL colors, not just black and white) and the possibility to quickly turn it on/off.

Concerning the second:

"It would be nice if LibreOffice had some kind of "night mode" that when turned on would draw the picture of the opened documents with inverted colors"
-->
"when turned on"

"qpdfview has a hot key that inverts colors for the opened documents, maybe the same could be implemented in LibreOffice?"

And concerning the first: the whole point is inverting ALL colors, because no theme is going to account for all colors that can be assigned by the sender of the document manually (https://bugs.documentfoundation.org/show_bug.cgi?id=114147#c5).
Comment 10 V Stuart Foote 2017-12-03 18:21:53 UTC
(In reply to Denis from comment #9)
What I suggested is pragmatic and achievable given our handling of colors drawn from DE theme (both GUI and the on-screen document representation). 

An arbitrary "inversion" of colors for the GUI and document will never be implemented--and we might as well close this as WONTFIX now. Sniping that this is not what you asked for is bogus.

The general case is for something functional to work in a Dark DE suitable for use in a low light environment without forcing the HC icon set--and picking document and font colors appropriate to the DE.
Comment 11 Heiko Tietze 2017-12-04 08:26:26 UTC
Taking all comments together the UX folks recommend to not implement this enhancement. You probably achieve it with an extension, and please share this with the world then. Such an extension would be a perfect example for how to customize LibreOffice.