Skip to content

Commit b53be49

Browse files
committed
[css-color-5] make examples match syntax, close w3c#5258
1 parent e38f8db commit b53be49

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

css-color-5/Overview.bs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ If no keyword is specified, it is as if ''shorter'' were specified.
164164
This example produces a mixture of 40% <span class="swatch" style="--color: peru"></span> peru
165165
and 60% <span class="swatch" style="--color: lightgoldenrod"></span> lightgoldenrod.
166166

167-
<pre class="lang-css">color-mix(peru lightgoldenrod 40%)</pre>
167+
<pre class="lang-css">color-mix(peru 40%, lightgoldenrod)</pre>
168168

169169
The mixing is done in ''lch()'' colorspace.
170170
Here is a top-down view, looking along the neutral L axis:
@@ -200,7 +200,7 @@ If no keyword is specified, it is as if ''shorter'' were specified.
200200
keeps the intermediate colors
201201
as saturated as the endpoint colors.
202202

203-
<pre class="lang-css">color-mix(teal olive 65%);</pre>
203+
<pre class="lang-css">color-mix(teal 65%, olive);</pre>
204204

205205
<figure>
206206
<img src="images/CH-mixing3.svg" style="width: 50vmin">
@@ -235,7 +235,7 @@ are copied across from the <em>first</em> color.
235235
(and thus, 60% of the lightness of the blue).
236236
The chroma and hue of the green are used unchanged in the mixed result.
237237

238-
<pre class="lang-css">color-mix(rgb(0% 42.35% 33.33%) rgb(41.2% 69.88% 96.64%) lightness(40%));</pre>
238+
<pre class="lang-css">color-mix(rgb(0% 42.35% 33.33%) lightness 40%, rgb(41.2% 69.88% 96.64%));</pre>
239239

240240
The calculation is as follows:
241241
* <span class="swatch" style="--color: rgb(0% 42.35% 33.33%)"></span> rgb(0% 42.35% 33.33%) is lch(40.083% 32.808 171.175)
@@ -254,7 +254,7 @@ are copied across from the <em>first</em> color.
254254
The shorter hue arc will be used.
255255
The chroma and lightness of the red are left unchanged.
256256

257-
<pre class="lang-css">color-mix(lch(52% 58.1 22.7) lch(56% 49.1 257.1) hue(75.23%));</pre>
257+
<pre class="lang-css">color-mix(lch(52% 58.1 22.7) hue 75.23%, lch(56% 49.1 257.1));</pre>
258258

259259
<figure>
260260
<img src="images/CH-mixing2.svg" style="width: 50vmin">
@@ -285,7 +285,7 @@ are copied across from the <em>first</em> color.
285285
The longer hue arc has been specified.
286286
The chroma and lightness of the red are left unchanged.
287287

288-
<pre class="lang-css">color-mix(lch(52% 58.1 22.7) lch(56% 49.1 257.1) hue(75.23% longer));</pre>
288+
<pre class="lang-css">color-mix(lch(52% 58.1 22.7) hue longer 75.23%, lch(56% 49.1 257.1) );</pre>
289289

290290
<figure>
291291
<img src="images/CH-mixing2b.svg" style="width: 50vmin">
@@ -318,7 +318,7 @@ are copied across from the <em>first</em> color.
318318
This time, the lightness is set to 68.4% and
319319
the chroma is left unchanged.
320320

321-
<pre class="lang-css">color-mix(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) hue(75.23%) lightness(68.4%));</pre>
321+
<pre class="lang-css">color-mix(rgb(82.02% 30.21% 35.02%) hue 75.23% lightness 68.4%, rgb(5.64% 55.94% 85.31%) );</pre>
322322

323323
The calculation is as follows:
324324
* <span class="swatch" style="--color: rgb(82.02% 30.21% 35.02%)"></span> rgb(82.02% 30.21% 35.02%) is lch(52% 58.1 22.7)
@@ -337,7 +337,7 @@ are copied across from the <em>first</em> color.
337337
with the mixture being 75.23% of that of the red
338338
(and thus, 24.77% of that of the blue).
339339

340-
<pre class="lang-css">color-mix(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) 75.23% xyz);</pre>
340+
<pre class="lang-css">color-mix(xyz rgb(82.02% 30.21% 35.02%) 75.23%, rgb(5.64% 55.94% 85.31%));</pre>
341341

342342
The calculation is as follows:
343343
* <span class="swatch" style="--color: rgb(82.02% 30.21% 35.02%)"></span> rgb(82.02% 30.21% 35.02%) is lch(52% 58.1 22.7) which is X=0.3214, Y=0.2014, Z=0.0879.
@@ -356,7 +356,7 @@ are copied across from the <em>first</em> color.
356356
(and thus, 70% of the lightness of yellow).
357357
The chroma and hue of red are left unchanged.
358358

359-
<pre class="lang-css">color-mix(red yellow lightness(30%));</pre>
359+
<pre class="lang-css">color-mix(red lightness 30%, yellow );</pre>
360360

361361
The calculation is as follows:
362362
* sRGB <span class="swatch" style="--color: red"></span> red (#F00) is lch(54.2917% 106.8390 40.8526)
@@ -423,9 +423,7 @@ which is rgb(52.446% 45.821% 62.953%)
423423
because interpolation is in a stright line on the <em>a,b</em> plane
424424
and can thus pass close to the central, neutral axis.
425425

426-
<pre class="lang-css">color-mix(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) lab() a(38%) b(38%));</pre>
427-
428-
<!-- is that right, lab() or lab ? -->
426+
<pre class="lang-css">color-mix(lab rgb(82.02% 30.21% 35.02%) a 38% b 38%, rgb(5.64% 55.94% 85.31%));</pre>
429427

430428
The calculation is as follows:
431429
* <span class="swatch" style="--color: rgb(82.02% 30.21% 35.02%)"></span> rgb(82.02% 30.21% 35.02%) is lab(52% 53.599 22.421)

0 commit comments

Comments
 (0)