Skip to content

Commit 26a5300

Browse files
committed
Rephrase interpolation to be more generic wrt to interpolation space instead of phrasing every other space as an exception to Lab
1 parent 4805c3c commit 26a5300

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

css-color-4/Overview.bs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4403,7 +4403,7 @@ Interpolation</h2>
44034403

44044404
In general, interpolation between <<color>> values
44054405
occurs by linearly interpolating each component of the computed value of the color
4406-
separately, in Lab.
4406+
separately, in a given color space which will be referred to as the 'interpolation space' below.
44074407

44084408
<!--
44094409

@@ -4441,26 +4441,26 @@ Interpolation</h2>
44414441

44424442
<h3 id="interpolation-space">
44434443
Color space for interpolation</h3>
4444-
4445-
Issue(5928):
4446-
4447-
Colors are first converted to Lab
4448-
and then interpolated as Lab colors.
4449-
Host syntax can override the interpolation color space and specify which color space is used for interpolation.
4450-
<!-- For example, 'color-mix' and 'color-adjust' override the default to LCH. -->
4451-
4452-
The exception is that if all the <<color>>s to be interpolated
4453-
are sRGB values, and they are all expressed in a legacy syntax
4454-
such as hex colors, named colors,
4444+
Different color spaces may be more appropriate for each interpolation use case.
4445+
For example, Lab works well for gradients, and LCH works well for color mixing.
4446+
The host syntax may define what the default interpolation space should be for each case,
4447+
and optionally provide syntax for authors to override this default.
4448+
4449+
If the host syntax does not define what colorspace interpolation should take place in,
4450+
it defaults to Lab. In that case, user agents may handle interpolation
4451+
between legacy sRGB color formats
4452+
(hex colors, named colors,
44554453
''rgb()'', ''hsl()'' or ''hwb()''
4456-
(and the equivalent alpha-including forms)
4457-
then they are interpolated in gamma-encoded sRGB space.
4458-
4454+
and the equivalent alpha-including forms)
4455+
in gamma-encoded sRGB space.
44594456
This provides Web compatibility; legacy sRGB content interpolates in the sRGB space by default.
44604457

44614458
This also means that authors can choose to opt-in to Lab interpolation
44624459
by using the non-legacy ''color(srgb r g b)'' form.
44634460

4461+
Issue(5928):
4462+
4463+
44644464
<h3 id="interpolation-alpha">
44654465
Interpolating with alpha</h3>
44664466

0 commit comments

Comments
 (0)