Skip to content

Commit e2d6d38

Browse files
committed
[css-color-5] Start on serializing specified RCS values, #9464
1 parent bbc6fc8 commit e2d6d38

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

css-color-5/Overview.bs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,6 +2837,24 @@ is the same as that specified in
28372837
Serializing Relative Color Functions
28382838
</h3>
28392839

2840+
The serialization of the specified value of a relative color function
2841+
is a string identifying the color function in all-lowercase,
2842+
followed by "(from ",
2843+
followed by the serialization of the specified value of the origin color,
2844+
followed by a single space,
2845+
followed by a singly-space-separated list of the arguments to the color function,
2846+
followed by ")".
2847+
2848+
<div class="example" id="ex-serial-rcs-specified-simple">
2849+
For example, the result of serializing the specified value
2850+
2851+
<pre class="lang-css">OkLcH(from peru l c h)</pre>
2852+
2853+
is the string "oklch(from peru l c h)"
2854+
</div>
2855+
2856+
<!-- need a more complex example, and one with calc too -->
2857+
28402858
The serialization of the result of a relative color function
28412859
is the resolved value.
28422860

@@ -2848,9 +2866,9 @@ The <em>minimum</em> precision for round-tripping
28482866
is the same as that specified in
28492867
[[css-color-4#serializing-color-function-values]].
28502868

2851-
<div class="example">
2869+
<div class="example" id="ex-serial-rcs-computed">
28522870
The result of serializing
2853-
<pre>lch(from peru calc(l * 0.8) calc(c * 0.7) calc(h + 180)) </pre>
2871+
<pre class="lang-css">lch(from peru calc(l * 0.8) calc(c * 0.7) calc(h + 180)) </pre>
28542872
is the string
28552873
<span class="swatch" style="--color: rgb(3.12% 50.352% 68.894%)"></span>
28562874
"lch(49.80224 37.80819 243.6803)"

0 commit comments

Comments
 (0)