Add experimental support to interpolate colors in other color spaces like lab / lch.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: emilio, Assigned: beth)
References
Details
Attachments
(1 file)
This is about adding support for color-mix(in lch, ....)
for example, even though if for now it has to convert from / to srgb after interpolation.
The reason I think this is a reasonable first step is because this would add the basic color representations / conversions between srgb / lch colors, and then support interpolating between them, without actually requiring to figure out how to store them efficiently in the computed style etc (which is the harder part of lab()
/ lch()
, tbh.
In order to fix this, the first step could be adding the basic enum ColorSpace { Srgb, Lch, ... }
, that derives Parse
, ToCss
, etc, and parses non-srgb color spaces behind a pref. Then we need to adapt this code to use it, and color-mix
to store it.
Once that's done, we'd need to actually honor it. That involves tweaking the animated::RGBA
color type to be able to support different interpolation spaces, or adding another type to represent an Lch color etc and then writing the interpolation code between those. That's the fun part.
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Out of gamut colours are currently clipped into sRGB.
Pushed by brennie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b8235b350c6c Support color-mix() in non-sRGB color spaces r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/29946 for changes under testing/web-platform/tests
Comment 4•3 years ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Description
•