@@ -1084,7 +1084,7 @@ the allowed [=channel keywords=] are:
10841084<div class="example">
10851085 To manipulate color channels in the sRGB color space:
10861086
1087- <pre>
1087+ <pre highlight=css >
10881088 rgb(from <span class="swatch" style="--color: indianred"></span> indianred 255 g b)
10891089 </pre>
10901090
@@ -1099,15 +1099,15 @@ Relative sRGB color syntax is <em>only</em> applicable to the non-legacy RGB syn
10991099 For example, this attempt to use the rgba
11001100 <a>legacy color syntax</a> with commas would be incorrect
11011101
1102- <pre>
1102+ <pre highlight=css >
11031103 rgba(from <span class="swatch" style="--color: darkblue"></span> darkblue 16, 32, b, 0.5 )
11041104 </pre>
11051105</div>
11061106
11071107<div class="example">
11081108 Instead, use
11091109
1110- <pre>
1110+ <pre highlight=css >
11111111 rgb(from <span class="swatch" style="--color: darkblue"></span> darkblue 16 32 b / 0.5 )
11121112 </pre>
11131113
@@ -1152,7 +1152,7 @@ the allowed [=channel keywords=] are:
11521152
11531153<div class="example">
11541154 This adds 180 degrees to the hue angle, giving a complementary color.
1155- <pre>
1155+ <pre highlight=css >
11561156 --accent: <span class="swatch" style="--color: lightseagreen"></span> lightseagreen;
11571157 --complement: <span class="swatch" style="--color: hsl(357deg 70% 41%)"></span> hsl(from var(--accent) calc(h + 180) s l);
11581158 </pre>
@@ -1232,7 +1232,7 @@ the allowed [=channel keywords=] are:
12321232<div class="example">
12331233 Fully desaturating a color to gray, keeping the exact same lightness:
12341234
1235- <pre>
1235+ <pre highlight=css >
12361236 --mycolor: <span class="swatch" style="--color: orchid"></span> orchid;
12371237 // orchid is lab(62.753 52.460 -34.103)
12381238 --mygray: <span class="swatch" style="--color: rgb(59.515% 59.515% 59.515%)"></span> lab(from var(--mycolor) l 0 0)
@@ -1306,7 +1306,7 @@ the allowed [=channel keywords=] are:
13061306
13071307<div class="example">
13081308 This adds 180 degrees to the hue angle, giving the complementary color.
1309- <pre>
1309+ <pre highlight=css >
13101310 --accent: <span class="swatch" style="--color: lightseagreen"></span> lightseagreen;
13111311 --complement: <span class="swatch" style="--color: rgb(88.2814% 51.1047% 58.3039%)"></span> lch(from var(--accent) l c calc(h + 180));
13121312 </pre>
@@ -1316,7 +1316,7 @@ the allowed [=channel keywords=] are:
13161316<div class="example">
13171317 Fully desaturating a color to gray, keeping the exact same lightness:
13181318
1319- <pre>
1319+ <pre highlight=css >
13201320 --mycolor: <span class="swatch" style="--color: orchid"></span> orchid;
13211321 // orchid is lch(62.753 62.571 326.973)
13221322 --mygray: <span class="swatch" style="--color: rgb(59.515% 59.515% 59.515%)"></span> lch(from var(--mycolor) l 0 h)
@@ -1325,7 +1325,7 @@ the allowed [=channel keywords=] are:
13251325
13261326 But now (since the hue was preserved) <em> re-saturating</em> again
13271327
1328- <pre>
1328+ <pre highlight=css >
13291329 --mymuted: <span class="swatch" style="--color: rgb(72.710% 53.293% 71.224%)"></span> lch(from var(--mygray) l 30 h);
13301330 // mymuted is lch(62.753 30 326.973) which is rgb(72.710% 53.293% 71.224%)
13311331 </pre>
@@ -1345,7 +1345,7 @@ However, unlike HSL, manipulations are not guaranteed to be in-gamut.
13451345
13461346 -->
13471347
1348- <pre>
1348+ <pre highlight=css >
13491349 --mycolor: <span class="swatch" style="--color: rgb(86.1% 33.4% 97.6%)"></span> lch(60% 90 320);
13501350 lch(from var(--mycolor) l c calc(h - 120));
13511351 </pre>
@@ -1386,7 +1386,7 @@ However, unlike HSL, manipulations are not guaranteed to be in-gamut.
13861386 Performing the same operation in HSL will return an in-gamut result.
13871387 But it is unsatisfactory in other ways:
13881388
1389- <pre>
1389+ <pre highlight=css >
13901390 --mycolor: <span class="swatch" style="--color: rgb(86.1% 33.4% 97.6%)"></span> lch(60% 90 320);
13911391 hsl(from var(--mycolor) calc(h - 120) s l);
13921392 </pre>
@@ -1447,7 +1447,7 @@ The origin color is inside the RGB gamut,
14471447but rotating the hue in Oklch
14481448again produces an out of gamut color.
14491449
1450- <pre>
1450+ <pre highlight=css >
14511451 --mycolor: <span class="swatch" style="--color: rgb(86.1% 33.4% 97.6%)"></span> lch(60% 90 320);
14521452 oklch(from var(--mycolor) l c calc(h - 120));
14531453</pre>
0 commit comments