@@ -1193,18 +1193,19 @@ will have a [=powerless=] hue component.
1193
1193
If a [=powerless component=] is manually specified,
1194
1194
it acts as normal;
1195
1195
the fact that it's [=powerless=] has no effect.
1196
+
1196
1197
However, if a color is automatically produced by color space conversion,
1197
1198
then any [=powerless components=] in the result must instead be set to [=missing=] ,
1198
1199
instead of whatever value was produced by the conversion process.
1199
1200
1200
- User agents <em> may</em> treat a component as [=powerless=]
1201
- if the color is "sufficiently close" to the precise conditions specified.
1202
- For example, a gray color converted into ''lch()'' may,
1201
+ When performing color space conversion to a [=cylindrical polar color=] space,
1202
+ user agents <em> shall</em> treat a hue component as [=powerless=]
1203
+ if the chroma (or other measure of colorfulness, such as saturation in ''hsl'' )
1204
+ is less than the epsilon (ε) specified for that color space.
1205
+ For example, a gray color converted into ''oklch()'' may,
1203
1206
due to numerical errors,
1204
1207
have an <em> extremely small</em> chroma rather than precisely ''0%'' ;
1205
- this can, at the user agent's discretion,
1206
- still treat the hue component as [=powerless=] .
1207
- It is intentionally unspecified exactly what "sufficiently close" means for this purpose.
1208
+ as a result, the hue component is [=powerless=] .
1208
1209
1209
1210
<h3 id=parse-color>
1210
1211
Parsing a <<color>> Value</h3>
@@ -2169,6 +2170,10 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
2169
2170
for S and L: 0% = 0.0, 100% = 100.0
2170
2171
</td>
2171
2172
</tr>
2173
+ <tr>
2174
+ <th> Powerless hue ε</th>
2175
+ <td> S <= 0.001</td>
2176
+ </tr>
2172
2177
</table>
2173
2178
2174
2179
<wpt>
@@ -2706,6 +2711,10 @@ HWB Colors: ''hwb()'' function</h2>
2706
2711
for W and B: 0% = 0.0, 100% = 100.0
2707
2712
</td>
2708
2713
</tr>
2714
+ <tr>
2715
+ <th> Powerless hue ε</th>
2716
+ <td> W + B >= 99.999</td>
2717
+ </tr>
2709
2718
</table>
2710
2719
2711
2720
The first argument specifies the hue,
@@ -3407,6 +3416,10 @@ Specifying Lab and LCH: the ''lab()'' and ''lch()'' functional notations</h3>
3407
3416
for C: 0% = 0, 100% = 150
3408
3417
</td>
3409
3418
</tr>
3419
+ <tr>
3420
+ <th> Powerless hue ε</th>
3421
+ <td> C <= 0.0015</td>
3422
+ </tr>
3410
3423
</table>
3411
3424
3412
3425
<wpt>
@@ -3576,6 +3589,10 @@ Specifying Lab and LCH: the ''lab()'' and ''lch()'' functional notations</h3>
3576
3589
for C: 0% = 0.0 100% = 0.4
3577
3590
</td>
3578
3591
</tr>
3592
+ <tr>
3593
+ <th> Powerless hue ε</th>
3594
+ <td> C <= 0.000004</td>
3595
+ </tr>
3579
3596
</table>
3580
3597
3581
3598
<wpt>
@@ -3653,8 +3670,8 @@ Converting Lab or Oklab colors to LCH or OKLCh colors</h3>
3653
3670
Conversion to the polar form is trivial:
3654
3671
3655
3672
<ol>
3656
- <li> H = atan2(b, a)
3657
3673
<li> C = sqrt(a^2 + b^2)
3674
+ <li> if (C > epsilon) H = atan2(b, a) else H is missing
3658
3675
<li> L is the same
3659
3676
</ol>
3660
3677
0 commit comments