Skip to content

Commit a0a9886

Browse files
committed
[css-color-4] Interpolation between legacy sRGB colors is (once again) in sRGB space, for compatibility. #7949
1 parent de89100 commit a0a9886

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

css-color-4/Overview.bs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4770,7 +4770,6 @@ Color Space for Interpolation</h3>
47704770
gradient/gradient-eval-008.html
47714771
gradient/gradient-eval-009.html
47724772
gradient/gradient-none-interpolation.html
4773-
gradient/legacy-color-gradient.html
47744773
gradient/oklab-gradient.html
47754774
gradient/srgb-gradient.html
47764775
gradient/srgb-linear-gradient.html
@@ -4784,43 +4783,42 @@ Color Space for Interpolation</h3>
47844783
interpolation should take place in,
47854784
it defaults to Oklab.
47864785

4787-
<!--
4788-
The following removed by CSSWG resolution
4789-
https://github.com/w3c/csswg-drafts/issues/7948#issuecomment-1479941072
4790-
4791-
RESOLVED: change specification say browser MUST use OKLab color interpolation
4792-
for all colors, including legacy colors
4793-
4794-
-->
4795-
<!-- However, user agents <em>may</em> handle interpolation
4786+
However, user agents <em>must</em> handle interpolation
47964787
between legacy sRGB color formats
47974788
(hex colors, named colors,
47984789
''rgb()'', ''hsl()'' or ''hwb()''
47994790
and the equivalent alpha-including forms)
48004791
in gamma-encoded sRGB space.
4801-
This provides Web compatibility; legacy sRGB content interpolates in the sRGB space by default.
4792+
This provides Web compatibility;
4793+
legacy sRGB content interpolates in the sRGB space by default.
4794+
4795+
<wpt pathprefix="css/css-images/">
4796+
gradient/legacy-color-gradient.html
4797+
</wpt>
48024798

48034799
This also means that authors can choose
48044800
to opt-in to better interpolation,
48054801
even between sRGB colors,
48064802
by using the non-legacy ''color(srgb r g b)'' form
4807-
for at least one of their colors. -->
4803+
for at least one of their colors,
4804+
or by explicitly specifying an [=interpolation color space=].
48084805

4809-
<!-- Now flip the previous paragraph,
4810-
authors that actually like sRGB interpolation can opt-in -->
4806+
<wpt>
4807+
/css/css-images/gradient/css-color-4-colors-default-to-oklab-gradient.html
4808+
</wpt>
48114809

4812-
Authors that prefer interpolation in sRGB
4810+
<!-- Authors that prefer interpolation in sRGB
48134811
in a particular instance
48144812
can opt-in to the old behavior
48154813
by explicitly specifying sRGB as the [=interpolation color space=],
4816-
for example on a particular gradient where that result is desired.
4814+
for example on a particular gradient where that result is desired. -->
48174815

48184816
If the colors to be interpolated are outside the gamut
48194817
of the [=interpolation color space=] ,
48204818
then once converted to that space,
48214819
they will contain out of range values.
48224820

4823-
These are not clipped, but the values are interpolated as-is.
4821+
These are not clipped; the values must be interpolated as-is.
48244822

48254823
<h3 id="interpolation-missing">
48264824
Interpolating with Missing Components</h3>
@@ -4893,6 +4891,10 @@ Interpolating with Missing Components</h3>
48934891
The Whiteness and Blackness components of HWB
48944892
have no analogs in other color spaces.
48954893

4894+
<wpt pathprefix="css/css-images/">
4895+
gradient/gradient-none-interpolation.html
4896+
</wpt>
4897+
48964898
<div class="example" id="ex-analogous-hue">
48974899
For example, if these two colors
48984900
are to be interpolated in OkLCh,

0 commit comments

Comments
 (0)