News for hackers. Stuff that matters.
Re:Portable EPUBs by steve1977 on Friday January 26, 2024 @12:59AM (#39139356)
> dark themes usually don't render good

PDFs should not render dark themes at all. PDFs should like exactly like they were produced. So if they were produced with black on white text, that's what they should render, in any circumstance.

Re:Portable EPUBs by o11c on Friday January 26, 2024 @01:31AM (#39139506)
Or it can just invert the L component of all colors in the HSL colorspace at the very last stage of rendering, which only requires a couple subtractions to do in sRGB.

Unlike the unfortunately common "invert directly in sRGB", this preserves the colors changing only the brightness, and honestly it's pretty good. Colorspace nerds will no doubt complain that there are better colorspaces available, but in practice, most consumer devices implement "sRGB" perceptually such that this works better than fancier methods (which only work for carefully calibrated displays in carefully calibrated rooms).

Re:Portable EPUBs by steve1977 on Friday January 26, 2024 @02:52AM (#39139900)
I didn’t say PDF cannot do it, I said it should not. It defeats the purpose of PDF.
Re:Portable EPUBs by Vecr on Friday January 26, 2024 @01:20AM (#39139461)
Zathura[0] has a dark mode[1], it works pretty well.

[0]: https://pwmt.org/projects/zathura/

[1]: ^r Recolor (grayscale and invert colors)