Skip to content

Commit d1f5f9f

Browse files
committed
[css-color-5] Specified value of color mix serializes with specified, not normalized, percentages w3c#8564
1 parent 20bfa00 commit d1f5f9f

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

css-color-5/Overview.bs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,14 +2592,32 @@ followed by the specified <<color-space>> in all-lowercase,
25922592
followed by ", ",
25932593
followed by the first specified color,
25942594
followed by a space,
2595-
followed by the normalized first percentage,
2595+
followed by the specified (un-normalized) first percentage (unless that is 50%),
25962596
followed by ", ",
25972597
followed by the second specified color,
2598+
followed by the specified (un-normalized) second percentage
2599+
(unless either that is 50%, or the two specified percentages add to 100%),
25982600
followed by ")".
25992601

26002602
Following the principle of shortest serialization,
2601-
and given that the normalized percentages are serialized,
2602-
the normalized second percentage is omitted.
2603+
the second percentage is typically omitted,
2604+
even if explicitly specified.
2605+
2606+
<div class="example" id="ex-serial-specified-mix">
2607+
For example, the serialized specified value of
2608+
<pre>color-mix(in oklab, teal, peru 40%)</pre>
2609+
would be the string "color-mix(in oklab, teal 60%, peru)".
2610+
2611+
The serialized specified value of
2612+
<pre>color-mix(in oklab, teal 50%, peru 50%)</pre>
2613+
would be the string "color-mix(in oklab, teal, peru)".
2614+
2615+
The serialized specified value of
2616+
<pre>color-mix(in oklab, teal 70%, peru 70%)</pre>
2617+
would be the string "color-mix(in oklab, teal 70%, peru 70%)"
2618+
because the fact that these normalize to 50% each
2619+
is only discoverfed after percentage normalization.
2620+
</div>
26032621

26042622
The serialization of the result of a ''color-mix()'' function
26052623
is a <<color>>,
@@ -2608,7 +2626,7 @@ The form used
26082626
depends on the color space specified with "in".
26092627

26102628
<wpt>
2611-
2629+
parsing/color-valid-color-mix-function.html
26122630
</wpt>
26132631

26142632
The <em>minimum</em> precision for round-tripping

0 commit comments

Comments
 (0)