Implement lab() and lch() from CSS Color Module Level 4
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: sebo, Assigned: tlouw, NeedInfo)
References
(Blocks 5 open bugs, )
Details
(Keywords: dev-doc-complete, Whiteboard: [layout:backlog])
Attachments
(1 file, 2 obsolete files)
CSS Color Module Level 4 defines lab() and lch() functions allowing to specify colors in Lab and LCH. This bug is meant to implement these two functions. Sebastian
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•5 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
webkit bug: https://bugs.webkit.org/show_bug.cgi?id=205675
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Reporter | ||
Updated•1 year ago
|
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 4•6 months ago
|
||
Some initial comments after first investigation:
- In the rust-cssparser library (that does the parsing only) assumes that all color spaces will be converted back to rgb. According to some comments from webkit bug and also looking at the styles and animation code it looks like we should rather just pass the values back to the consumer of the lib in the formats that is being parsed. So in stead of RGB we return {r, g, b}, {l, a, b}, {l, c, h}, {h, s, l}, etc.
- The second problem is that the conversion functions used in css-color-5 is mostly implemented in gecko already and we don't have access to those from rust-cssparser. Having to convert to RGB would require a duplication of the code or extracting the conversion functions to separate lib. (Which is not a bad idea in general I think. Really handy functions)
Choosing whether to convert to sRGB or to store the parsed values is an implementation detail provided that extended-range sRGB is being converted to/from (ie values <0 and >1.0 are preserved). Modulo some round-trip error of course.
Since the original bug was filed, CSS Color 4 has added oklab() and oklch() which are significantly better than Lab/LCH in terms of perceptual uniformity, are used for gradient interpolation and gamut mapping, and also don't require chromatic adaptation between D65 and D50 white points which is another source of cumulative round-off error.
Updated•5 months ago
|
Assignee | ||
Comment 6•4 months ago
|
||
Assignee | ||
Comment 7•4 months ago
|
||
Depends on D163450
Assignee | ||
Comment 8•4 months ago
|
||
Depends on D163450
Updated•4 months ago
|
Updated•4 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 9•2 months ago
|
||
Similar to guidance on :has in https://bugzilla.mozilla.org/show_bug.cgi?id=418039#c62, may we know roughly when Firefox intends to ship this?
Comment 10•2 months ago
|
||
Pushed by tlouw@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/218b12b92ccb Add lab(), lch(), oklab(), oklch() to specified colors. r=supply-chain-reviewers,emilio
Assignee | ||
Comment 11•2 months ago
|
||
(In reply to Alexandre Dieulot from comment #9)
Similar to guidance on :has in https://bugzilla.mozilla.org/show_bug.cgi?id=418039#c62, may we know roughly when Firefox intends to ship this?
We are actively working on some color-4 improvements and you can expect a release in the coming months.
Comment 12•2 months ago
|
||
Backed out for causing failures on test_transitions_per_property.html.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=402896632&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/2324abe2eb7c71666c6adc98d377bfa4fe71a731
Comment 13•2 months ago
|
||
Pushed by tlouw@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3fa8d29c7c44 Add lab(), lch(), oklab(), oklch() to specified colors. r=supply-chain-reviewers,emilio
Comment 15•2 months ago
|
||
bugherder |
Assignee | ||
Comment 16•2 months ago
|
||
These changes are currently under the layout.css.more_color_4.enabled
preference.
Comment 17•23 days ago
|
||
Documentation changes for this are being tracked in the following issue on GitHub: https://github.com/mdn/content/issues/24395
Updated•17 days ago
|
Description
•