Closed Bug 1703356 Opened 3 years ago Closed 3 years ago

Add experimental support to interpolate colors in other color spaces like lab / lch.

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: emilio, Assigned: barret)

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.

Blocks: 1352757
No longer depends on: 1352757
Assignee: nobody → brennie
Status: NEW → ASSIGNED
Severity: -- → S3

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
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: