Skip to content

Commit bc56eb2

Browse files
committed
[css-color-4] Expand analogous components to analogous sets to minimize none → 0 conversions #10210
Resolution from #10210 (comment)
1 parent 0953613 commit bc56eb2

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

css-color-4/Overview.bs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4989,6 +4989,15 @@ Interpolating with Missing Components</h3>
49894989
before premultiplication, and
49904990
before linear interpolation takes place.
49914991

4992+
Similarly, if every component of an [=analogous set=]
4993+
(defined below)
4994+
in the original color
4995+
is a [=missing component=],
4996+
they are all [=carried forward=]
4997+
and re-inserted
4998+
in the corresponding [=analogous set=]
4999+
of the [=interpolation color space=].
5000+
49925001
The <dfn export>analogous components</dfn> are as follows:
49935002

49945003
<table>
@@ -5041,6 +5050,41 @@ Interpolating with Missing Components</h3>
50415050
The Whiteness and Blackness components of HWB
50425051
have no analogs in other color spaces.
50435052

5053+
Additionally, for any two color spaces,
5054+
the components that remain
5055+
after removing all [=analogous components=]
5056+
form an <dfn export>analogous set</dfn> of components.
5057+
5058+
Note: Because the full set of all color components
5059+
is the [=analogous set=] that remains
5060+
when there are no individual [=analogous components=],
5061+
a color with all color components [=missing=]
5062+
will have all color components [=missing=]
5063+
in the [=interpolation color space=] as well.
5064+
5065+
<div class="example" id="ex-analogous-set">
5066+
When converting
5067+
<code class="lang-css">lab(50% none none)</code> to LCH
5068+
for interpolation,
5069+
Lightness is individually [=analogous components|analogous=].
5070+
The remaining components
5071+
(''a'' and ''b'' in Lab; ''C'' and ''H'' in LCH)
5072+
form an [=analogous set=].
5073+
Since both ''a'' and ''b'' are [=missing=],
5074+
both ''C'' and ''H'' are carried forward as [=missing=],
5075+
giving <code class="lang-css">lch(50% none none)</code>
5076+
rather than <code class="lang-css">lch(50% 0 0)</code>.
5077+
5078+
Similarly,
5079+
<code class="lang-css">rgb(none none none / 50%)</code>
5080+
converted to OKLab for interpolation
5081+
yields <code class="lang-css">oklab(none none none / 50%)</code>,
5082+
because the three color components
5083+
form the [=analogous set=]
5084+
(there are no individual [=analogous components=]
5085+
between sRGB and OKLab).
5086+
</div>
5087+
50445088
<wpt pathprefix="css/css-images/">
50455089
gradient/gradient-none-interpolation.html
50465090
</wpt>
@@ -7905,6 +7949,9 @@ Changes</h2>
79057949
<h3 id="changes-from-20240213">Changes since the <a href="https://www.w3.org/TR/2024/CRD-css-color-4-20240213/">Candidate Recommendation Draft of 13 Feb 2024</a></h3>
79067950

79077951
<ul>
7952+
<li>Expanded the concept of analogous components to analogous sets of components, to minimize ''none''''0'' conversions
7953+
(<a href="https://github.com/w3c/csswg-drafts/issues/10210">Issue 10210</a>)
7954+
</li>
79087955
<!-- to 21 Apr 2025 -->
79097956
<li>Clarified that inside the color property, it is the resolved inherited value (not the raw inherited value) that is used</li>
79107957
<li>Listed categories of colors, such as those that resolve to sRGB or support legacy color syntax</li>

0 commit comments

Comments
 (0)