@@ -1268,10 +1268,10 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
1268
1268
across hues.
1269
1269
1270
1270
<div class="example">
1271
- For example, <span class="swatch" style="--color: blue"></span> ''blue'' '
1271
+ For example, <span class="swatch" style="--color: blue"></span> ''blue''
1272
1272
is represented in HSL as
1273
- <span class="swatch" style="--color: blue"></span> ''hsl(240deg 100% 50%)
1274
- while <span class="swatch" style="--color: yellow"></span> '' yellow'''
1273
+ <span class="swatch" style="--color: blue"></span> ''hsl(240deg 100% 50%)''
1274
+ while <span class="swatch" style="--color: yellow"></span> ''yellow''
1275
1275
is <span class="swatch" style="--color: yellow"></span> ''hsl(60deg 100% 50%)'' .
1276
1276
Both have an HSL Lightness of 50%,
1277
1277
but clearly the yellow looks much lighter than the blue.
@@ -1302,24 +1302,24 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
1302
1302
<span class="swatch" style="--color: hsl(220 100% 50%)"></span> ''hsl(220deg 100% 50%)''
1303
1303
and
1304
1304
<span class="swatch" style="--color: hsl(250 100% 50%)"></span> ''hsl(250deg 100% 50%)''
1305
- have an HSL hue difference of 30deg and look fairly similar,
1305
+ have an HSL hue difference of 250-220 = <strong> 30 </strong> deg and look fairly similar,
1306
1306
while another pair of colors
1307
1307
<span class="swatch" style="--color: hsl(50 100% 50%)"></span> ''hsl(50deg 100% 50%)''
1308
1308
and
1309
1309
<span class="swatch" style="--color: hsl(80 100% 50%)"></span> ''hsl(80deg 100% 50%)'' ,
1310
- which also have a hue difference of 30deg , look very different.
1310
+ which also have a hue difference of 80-50 = <strong> 30 </strong> deg , look very different.
1311
1311
1312
1312
In LCH, the same pair of colors
1313
1313
<span class="swatch" style="--color: hsl(220 100% 50%)"></span> ''lch(42.1% 97.4 290.6)''
1314
1314
and
1315
1315
<span class="swatch" style="--color: hsl(250 100% 50%)"></span> ''lch(30.8% 129.7 302.1)''
1316
- have a hue difference of 11.5deg
1316
+ have a hue difference of 302.1-290.6 = <strong> 11.5 </strong> deg
1317
1317
while the second pair
1318
1318
<span class="swatch" style="--color: hsl(50 100% 50%)"></span> ''lch(86.8% 86.2 87.3)''
1319
1319
and
1320
1320
<span class="swatch" style="--color: hsl(80 100% 50%)"></span> ''lch(92.0% 98.8 119.1)''
1321
- have a hue difference of 31.8deg
1322
- reflecting the visual separation of hues.
1321
+ have a hue difference of 119.1-87.3 = <strong> 31.8 </strong> deg,
1322
+ correctly reflecting the visual separation of hues.
1323
1323
1324
1324
</div>
1325
1325
@@ -2253,10 +2253,10 @@ Specifying Lab and LCH: the ''lab()'' and ''lch()'' functional notations</h3>
2253
2253
</div>
2254
2254
2255
2255
<h3 id='rgb-to-lab'>
2256
- Converting sRGB colors to Lab colors</h3>
2256
+ Converting RGB colors to Lab colors</h3>
2257
2257
2258
- Conversion from sRGB to Lab requires several steps,
2259
- although in practice all but the first step are linear calculations and can be combined.
2258
+ Conversion from an RGB colorspace to Lab requires several steps,
2259
+ although in practice all but the first step are linear calculations and can be combined. Taking sRGB as an example:
2260
2260
2261
2261
<!-- make these steps links to the appropriate section in a calculations appendix -->
2262
2262
<ol>
@@ -2271,20 +2271,25 @@ Converting sRGB colors to Lab colors</h3>
2271
2271
<li> Convert D50-adapted XYZ to Lab
2272
2272
</ol>
2273
2273
2274
- There is sample JavaScript code for this conversion in [[#color-conversion-code]].
2274
+ There is sample JavaScript code for this conversion
2275
+ for various RGB colorspaces, in [[#color-conversion-code]] .
2275
2276
2276
2277
<h3 id='lab-to-rgb'>
2277
- Converting Lab colors to sRGB colors</h3>
2278
+ Converting Lab colors to RGB colors</h3>
2278
2279
2279
- Conversion from Lab to sRGB also requires multiple steps,
2280
- and again in practice all but the last step are linear calculations and can be combined.
2280
+ For display on a screen,
2281
+ Lab colors will need to be converted
2282
+ to the colorspace of the display.
2283
+
2284
+ Conversion from Lab to an RGB space also requires multiple steps,
2285
+ and again in practice all but the last step are linear calculations and can be combined. Taking display-p3 as an example,
2281
2286
2282
2287
<ol>
2283
2288
<li> Convert Lab to (D50-adapted) XYZ
2284
2289
<li> Convert from a D50 whitepoint (used by Lab) to the D65 whitepoint used
2285
- in sRGB , with the Bradford transform
2286
- <li>Convert from (D65-adapted) CIE XYZ to linear sRGB
2287
- <li>Convert from linear-light sRGB to sRGB (do gamma encoding)
2290
+ in display-p3 , with the Bradford transform
2291
+ <li> Convert from (D65-adapted) CIE XYZ to linear-light display-p3
2292
+ <li> Convert from linear-light display-p3 to display-p3 (do gamma encoding)
2288
2293
</ol>
2289
2294
2290
2295
<h3 id='lab-to-lch'>
0 commit comments