Re: [csswg-drafts] [css-color-4] Allow out-of-gamut HSL/HWB colors (previously "Move gamut mapping to a future spec") (#8444)

Unbounded legacy `rgb()` does not seem Web-compatible; there were [already tests for CSS Color 3](https://wpt.fyi/results/css/css-color/parsing/color-valid.html?label=experimental&label=master&aligned) that checked (based on a suggestive comment, not actual spec text) that values outside of 0,255 got _clipped_. The [actual spec text in CSS Color 3](https://www.w3.org/TR/css-color-3/#rgb-color) is looser:

> Values outside the device gamut should be clipped or mapped into the gamut when the gamut is known: the red, green, and blue values must be changed to fall within the range supported by the device. User agents may perform higher quality mapping of colors from one gamut to another. This specification does not define precise clipping behavior. 

There were no such tests for CSS Color 4 despite [actual spec text](https://drafts.csswg.org/css-color-4/#serializing-sRGB-values) :

>  the component values are serialized in base 10, with a range of [0-255], regardless of the bit depth with which they are stored.

so I [made a PR](https://github.com/web-platform-tests/wpt/pull/39451) to extend `parsing/color-valid-rgb` which tests for simple clipping of specified `rgb()` and `rgba()` values that are out of gamut.

Testing that on Chrome and Firefox they both clip. I would need to get a hold of a Mac to test on Safari.

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8444#issuecomment-1502018563 using your GitHub account


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

Received on Monday, 10 April 2023 16:18:13 UTC