Skip to content

Commit 55eb4e6

Browse files
committed
[css-color-5][editorial] Add examples of RCD alpha() serialization, w3c#13994
1 parent dbb54ef commit 55eb4e6

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

css-color-5/Overview.bs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,6 +3643,23 @@ is the string "color(srgb 0 0 0.5)"
36433643

36443644
</div>
36453645

3646+
<div class="example" id="ex-serial-rcs-modern-alpha">
3647+
For example, the serialization of the declared value of
3648+
3649+
<pre class="lang-css">alpha(from red / 0.5)</pre>
3650+
3651+
is the string "color(srgb 1 0 0 / 0.5)"
3652+
because trailing zeros are trimmed,
3653+
while the serialization of the declared value of
3654+
3655+
<pre class="lang-css">alpha (from gold / calc(2/3))</pre>
3656+
3657+
is the string "color(srgb 1 0.843137 0 / 0.666667)"
3658+
because, by [[css-color-4#serializing-modern-alpha-values]]
3659+
modern alpha values are serialized with six decimal places
3660+
(unless there are trailing zeroes).
3661+
</div>
3662+
36463663

36473664
The serialization of the result of a relative color function
36483665
depends on whether the keyword ''currentColor'' is the [=origin color=].

0 commit comments

Comments
 (0)