@@ -283,8 +283,6 @@ If no target contrast is specified</h4>
283
283
284
284
285
285
286
-
287
-
288
286
<!--
289
287
████████ ████████ ██████ ███████ ██ ██ ██ ████████
290
288
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
@@ -306,8 +304,7 @@ If no target contrast is specified</h4>
306
304
resolved according to [[css-color-4#resolving-color-values]] .
307
305
Otherwise (if ''currentColor'' was used in the function),
308
306
the computed value is the ''contrast-color()'' function
309
- with each <<color>> parameter resolved according to [[css-color-4#resolving-color-values]] ,
310
- and the keywords ''AA'' , ''AA-large'' , ''AAA'' , ''AAA-large'' replaced with their corresponding numeric value,
307
+ with each component [=computed|computed value=] ,
311
308
thus preserving inheritance into child elements.
312
309
313
310
<div class="example">
@@ -365,79 +362,23 @@ to add serialization of the
365
362
results of the
366
363
''contrast-color()'' function.
367
364
368
- In this section, the strings used in the specification and the corresponding characters are as follows.
369
-
370
- <table class="data">
371
- <tr>
372
- <th> String</th>
373
- <th> Character</th>
374
- </tr>
375
- <tr>
376
- <td> " "</td>
377
- <td> U+0020 SPACE</td>
378
- </tr>
379
- <tr>
380
- <td> ","</td>
381
- <td> U+002C COMMA</td>
382
- </tr>
383
- <tr>
384
- <td> "-"</td>
385
- <td> U+002D HYPHEN-MINUS</td>
386
- </tr>
387
- <tr>
388
- <td> "."</td>
389
- <td> U+002E FULL STOP</td>
390
- </tr>
391
- <tr>
392
- <td> "/"</td>
393
- <td> U+002F SOLIDUS</td>
394
- </tr>
395
- </table>
396
-
397
- The string "." shall be used as a decimal separator,
398
- regardless of locale,
399
- and there shall be no thousands separator.
400
-
401
- As usual,
402
- if the alpha of the result is exactly 1,
403
- it is omitted from the serialization;
404
- an implicit value of 1 (fully opaque) is the default.
405
-
406
365
Serializing contrast-color() {#serial-contrast-color}
407
366
-----------------------------------------------------
408
367
409
- The serialization of the result of a ''contrast-color()'' function
410
- is a <<color>> ,
411
- as defined in [[css-color-4#serializing-color-values]] .
412
- The form used
413
- is the same as that used to specify
414
- the winning color.
368
+ The [=specified value=] of the ''contrast-color()'' function
369
+ is serialized with each keyword value as specified
370
+ and each component in canonical order .
371
+
372
+ The [=resolved value=] of the ''contrast-color()'' function
373
+ is the [=used color=] serialized the same as any other <<color>> .
415
374
416
375
<!--
417
376
<wpt>
418
377
parsing/color-contrast-computed.html
419
378
</wpt>
420
379
-->
421
380
422
- The <em> minimum</em> precision for round-tripping
423
- is the same as that specified in
424
- [[css-color-4#serializing-color-values]] .
425
-
426
- <div class="example">
427
- The winner of this contrast choice
428
- <pre> contrast-color(wheat tbd-bg wcag2, olive, sienna, maroon)</pre>
429
- is maroon,
430
- so the result is serialized as
431
- <span class="swatch" style="--color: maroon"></span>
432
- "rgb(128 0 0)".
433
-
434
- While the winner of
435
- <pre> contrast-color(wheat tbd-bg wcag2, color(prophoto-rgb 0.4 0.4 0.2), color(display-p3 0.45 0.08 0.05))</pre>
436
- is color(display-p3 0.45 0.08 0.05),
437
- so the result is serialized as
438
- <span class="swatch" style="--color: rgb(49.277% 0.414% 0.524%)"></span>
439
- "color(display-p3 0.45 0.08 0.05)".
440
- </div>
381
+
441
382
442
383
<!--
443
384
██████ ████████ ██████ ██ ██ ████████ ████ ████████ ██ ██
0 commit comments