baskerville / plato

Document reader
Other
1.23k stars 102 forks source link

Sleep screen should respect the inverted color choice #353

Closed randomnoise closed 4 months ago

randomnoise commented 5 months ago

When reading in the dark and Invert Colors enabled, if the e-reader suspends, Sleeping intermission screen uses white background and for a few seconds frontlight glares. It hurts the eyes even with the low frontlight intensity.

At least when Invert Colors is enabled, the Sleeping screen should use black blackground (similar to Powered off intermission screen).

Settings.toml:

[intermissions]
suspend = "logo:"
NiLuJe commented 5 months ago

Likely the flash. Can't really be helped on devices without proper Eclipse waveform modes (i.e,, Mk 8+). (I mean, if you want to keep the flash, that is :D. And you generally do.).

(IIRC, there's a Plato fork that attempts to modulate the frontlight level during nightmode refreshes, but that's extremely difficult to achieve in a consistent manner across a wide range of devices in my experience (outside of doing in in-kernel), so, YMMV).

randomnoise commented 4 months ago

@NiLuJe, thanks for the information. Flash contributes to the situation and I don't want to deal with the kernel space on e-readers yet, I am new to this stuff 😄

The issue that I am having is related to the Plato though, it isn't about hardware or kernel. I opened the issue as a feature request but I think that it is a Plato bug.

I've skimmed through the code and I found this: https://github.com/baskerville/plato/blob/81f19ab0f2d8dfba78fad0c8b642b02393097b1f/crates/core/src/view/intermission.rs#L62-L67

It looks like the code handles what I was asking (using black background in sleep screen if color is inverted) but there are if fb.inverted() { code blocks following that. So, I think the code undoes the change it did in the first place.

I think it should just be

let scheme = TEXT_NORMAL;

or something similar.

randomnoise commented 4 months ago

To make the my suggestion clear visually, in stock Plato 0.9.40, Home screen with inverted color and Sleeping screen with white background:

03-inverted-main-menu 04-inverted-sleeping