Skip to content

Commit e629669

Browse files
committed
[css-color-4] Add example of specified out of range alpha, both with and without calc #8318
1 parent d4ef154 commit e629669

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

css-color-4/Overview.bs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5620,6 +5620,20 @@ Serializing alpha values</h3>
56205620
</p>
56215621
</div>
56225622

5623+
Because <<alpha-value>>s which were specified outside the valid range
5624+
are clamped at parse time, the specified value will be clamped.
5625+
However, per [[css-values-4#calc-range]], <<alpha-value>>s
5626+
specified using calc() are not clamped when the specified form is serialized;
5627+
but the computed values are clamped.
5628+
5629+
<div class="example" id="ex-alpha-clamp">
5630+
<p>For example an alpha value which was specified directly as 120%
5631+
would be serialized as the string "1".
5632+
However, if it was specified as calc(2*60%)
5633+
the specified value would be serialized as the string "calc(1.2)".
5634+
</p>
5635+
</div>
5636+
56235637

56245638
<h3 id="serializing-sRGB-values">
56255639
Serializing sRGB values</h3>
@@ -5767,6 +5781,8 @@ Serializing sRGB values</h3>
57675781
and not the string "rgb(218.000, 165.000, 32.000)"</p>
57685782
</div>
57695783

5784+
5785+
57705786
<h3 id="serializing-lab-lch">
57715787
Serializing Lab and LCH values</h3>
57725788

0 commit comments

Comments
 (0)