Inverting colors for images in dark mode

Looking at [1] in dark mode makes the image quite bright.

Bert just introduced me to the "filter: invert(1)" magic.
   https://www.w3.org/2025/Talks/AC/intro-tech-program/#rec-track

[[
@media (prefers-color-scheme: dark) {
  [...]
  .can-invert {filter: invert(1)} /* For images whose colors can be 
inverted */
}

]]
https://www.w3.org/2025/Talks/AC/Templates/slides.css


So, I'm wondering if adding those rules in the /TR style sheet would be 
useful
  https://www.w3.org/StyleSheets/TR/2021/dark.css

ie, if you believe your image "supports darkmode", you would be able to add
  class="can-invert" on IMG and SVG elements

opinions?

Philippe

[1] https://www.w3.org/TR/navigation-timing-2/#processing-model

Received on Tuesday, 25 March 2025 14:56:13 UTC