[csswg-drafts] [css-color-5] Should intermediate out of range values be preserved in color-mix? (#10414)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] Should intermediate out of range values be preserved in color-mix? ==
[Preserving intermediate out of range values in relative colors](https://drafts.csswg.org/css-color-5/#rcs-intro) is explicitly required since this [commit](https://github.com/w3c/csswg-drafts/commit/4429f5f511be30214d2202670f927aeaea264cea) following this [comment](https://github.com/w3c/csswg-drafts/issues/9759#issuecomment-1889541570):

  > [...] the whole reason we added the serialization of RCS `rgb()`, `hsl()` and `hwb()` to `color(srgb)` specifically to enable round-tripping of out of gamut values. [...] CSS Color 5 needs to specifically say that RCS versions of those color functions do not clamp out of range values.

`color-mix()` must also [serialize](https://drafts.csswg.org/css-color-5/#serial-color-mix) with `color-mix(in srgb, ...)` instead of `rgb()`. Is it also intended to preserve intermediate out of range values?

For example, what should be the resolved value of `color-mix(in srgb, rgb(270 0 0), rgb(270 0 0))`?

  1. `color(srgb 1 0 0)`
  2. `color(srgb 1.058823 0 0)`

1 is the current output in Chrome and FF (at least) and is equivalent to `color-mix(in srgb, rgb(255 0 0), rgb(255 0 0))`, ie. intermediate out of range values are clamped.

2 is derived from the output of `new Color('rgb(270 0 0)').coords` with the `color-js` library (which serializes as `rgb(255 33.838 23.697)` though).

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10414 using your GitHub account


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

Received on Monday, 10 June 2024 06:53:17 UTC