Infra: Only invert image brightness, not hue#2949
Conversation
|
Yyyyyyeeah that's a big improvement 🤣 Looks good. |
|
Thanks! The red used in light mode is a bit dark, so contrast isn’t ideal to start with, but that cyan really makes it much worse. |
|
Seems like a great change overall, thanks. However, even a cursory check of the render previews revealed a serious problem, albeit not directly due to the changes in this PR. Since the last build yesterday, Sphinx jumped 3 (!) versions in one day (from 6.0.0 to 6.1.1, the latter of which isn't even documented in the Sphinx changelog linked in the 6.1.1 release, which seems to be because the change wasn't yet merged/built for On a related note, I've learned the hard way to always spend a few seconds checking the render preview before approving or merging, which it appears no one did 🙂 EDIT: ...Aaaand it's broken now. I'll rush through a PR to confirm the exact version affected and upper-cap it to one before, and hopefully it can be fixed upstream. Ironically, the very first build it affected was that of this PR which was all about modifying the display of images; while initially that made the investigation take much longer, without that it may have been a while before one of us noticed (as isn't obvious the images are missing that should be there unless you are on PEPs that have then and specifically are looking for them). |
In #2409, CSS was added to invert images that would otherwise be hard to see on dark background.
Since inversion doesn’t just affect brightness, but also hue, there’s a problem: Some background colors have perceptually less contrast with their text when hue rotated.
This PR rotates their hue back, fixing this. Also I prefer the less vaporware aesthetic of the original colors. E.g. the white-on-red is much more readable than white-on-cyan in PEP 458: