Description
Preserving intermediate out of range values in relative colors is explicitly required since this commit following this comment:
[...] the whole reason we added the serialization of RCS
rgb()
,hsl()
andhwb()
tocolor(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 with color(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))
?
color(srgb 1 0 0)
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).