RESOLVED FIXED 221873
Add experimental support for CSS Color 5 color transformations
https://bugs.webkit.org/show_bug.cgi?id=221873
Summary Add experimental support for CSS Color 5 color transformations
Sam Weinig
Reported 2021-02-13 19:54:28 PST
Now that we have adequate support for static color types and CSS Color 4, we should look at adding experimental support for the color transformation functions and syntax of CSS Color 5 - https://drafts.csswg.org/css-color-5/. From doing an initial look, I have spotted a few initial things that we will need to consider: - How should we handle transformations of color keywords that are currently not resolved until something like colorFromPrimitiveValue is called? The most basic example would be doing something like `color-mix(lch currentColor 40%, red)`. My hunch is we will want to create a new CSSValue type to store these pending-colors (perhaps limited only to the cases we can't do them eagerly). - How can we inject constants into the environment for calc()? For the relative color syntax, the spec seems to want injection of named constants into css calc() functions. For instance, one example includes the following: `color: hsl(from var(--accent) calc(h+180) s l);` In this example, the "h" should be numeric value of the hue channel of var(--accent) converted to HSL. We will have to see what the best way to model this in the current CSS calc infrastructure is.
Attachments
Radar WebKit Bug Importer
Comment 1 2021-02-20 19:55:11 PST
Sam Weinig
Comment 2 2021-11-26 10:57:00 PST
This is now complete.
Note You need to log in before you can comment on or make changes to this bug.