[fxtf-drafts] [filter-effects] hue-rotate() is not accurate for saturated colors (#420)

AlexApps99 has just created a new issue for https://github.com/w3c/fxtf-drafts:

== [filter-effects] hue-rotate() is not accurate for saturated colors ==
The [current definition of `hue-rotate()`](https://drafts.fxtf.org/filter-effects/#huerotateEquivalent) is based on an SVG filter, which uses a matrix transformation on RGB color to calculate the resultant color.

This is not very desirable for some usecases, for example, a general CSS userstyle to make pages appear like a "dark mode" with `invert(100%) hue-rotate(180deg)` on the entire document, then selectively `hue-rotate(-180deg) invert(100%)` to elements such as images and videos.

I would expect a style like this to undo the effects of the inversion, so the colors of the elements are normally colored.
The actual effect is slightly off-color, due to the limitations of the current method of `hue-rotate()`.

While it is extremely unlikely the current definition can be changed, it would be great if a new effect could be added that behaved as expected.

Relevant discussion:
- https://bugs.chromium.org/p/chromium/issues/detail?id=237524
- https://stackoverflow.com/questions/19187905/why-doesnt-hue-rotation-by-180deg-and-180deg-yield-the-original-color
- https://stackoverflow.com/questions/16329507/webkit-filters-hue-rotate-does-not-seem-to-produce-correct-results-in-chrome


Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/420 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 8 April 2021 22:58:44 UTC