Skip to content

Commit ad75a8d

Browse files
committed
[css-typed-om] Specify which color function each CSSColorValue subclass represents, and add CSSGray.
1 parent b1d19e9 commit ad75a8d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

css-typed-om/Overview.bs

+39
Original file line numberDiff line numberDiff line change
@@ -2874,6 +2874,8 @@ has the same behavior as in normal CSS.
28742874
-----------------------------------------------
28752875

28762876
{{CSSColorValue}} objects represent <<color>> values.
2877+
It is an abstract superclass,
2878+
with the subclasses representing individual CSS color functions.
28772879

28782880
<xmp class='idl'>
28792881
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
@@ -3013,6 +3015,8 @@ interface CSSColor : CSSColorValue {
30133015

30143016
Issue: TODO add stringifiers
30153017

3018+
The {{CSSRGB}} class represents the CSS ''rgb()''/''rgba()'' functions.
3019+
30163020
<div algorithm="CSSRGB()">
30173021
The <dfn constructor for=CSSRGB>CSSRGB(|r|, |g|, |b|, optional |alpha|)</dfn> constructor
30183022
must, when invoked,
@@ -3041,6 +3045,8 @@ Issue: TODO add stringifiers
30413045
and set the corresponding internal slot to the result of that.
30423046
</div>
30433047

3048+
The {{CSSHSL}} class represents the CSS ''hsl()''/''hsla()'' functions.
3049+
30443050
<div algorithm="CSSHSL()">
30453051
The <dfn constructor for=CSSHSL>CSSHSL(|h|, |s|, |l|, optional |alpha|)</dfn> constructor
30463052
must, when invoked,
@@ -3068,6 +3074,8 @@ Issue: TODO add stringifiers
30683074
and set the corresponding internal slot to the result of that.
30693075
</div>
30703076

3077+
The {{CSSHWB}} class represents the CSS ''hwb()'' function.
3078+
30713079
<div algorithm="CSSHWB()">
30723080
The <dfn constructor for=CSSHWB>CSSHWB(|h|, |w|, |b|, optional |alpha|)</dfn> constructor
30733081
must, when invoked,
@@ -3095,6 +3103,33 @@ Issue: TODO add stringifiers
30953103
and set the corresponding internal slot to the result of that.
30963104
</div>
30973105

3106+
The {{CSSGray}} class represents the CSS ''gray()'' function.
3107+
3108+
<div algorithm="CSSGray()">
3109+
The <dfn constructor for=CSSGray>CSSGray(|l|, optional |alpha|)</dfn> constructor
3110+
must, when invoked,
3111+
perform the following steps:
3112+
3113+
1. Let |l| and |alpha|
3114+
be replaced by the result of [=rectifying a percentish value=].
3115+
If |l| and |alpha| don't both [=CSSNumericValue/match=] "percent",
3116+
[=throw=] a {{TypeError}}.
3117+
3118+
3. Return a new {{CSSGray}}
3119+
with its {{CSSGray/l}} and {{CSSGray/alpha}} internal slots
3120+
set to |l|, and |alpha|.
3121+
</div>
3122+
3123+
<div algorithm="CSSGray.l">
3124+
The <dfn attribute for=CSSGray>l</dfn>
3125+
and <dfn attribute for=CSSGray>alpha</dfn> attributes of a {{CSSGray}} value
3126+
must, on setting to a new value |val|,
3127+
[=rectify a percentish value=] from |val|
3128+
and set the corresponding internal slot to the result of that.
3129+
</div>
3130+
3131+
The {{CSSLCH}} class represents the CSS ''lch()'' function.
3132+
30983133
<div algorithm="CSSLCH()">
30993134
The <dfn constructor for=CSSLCH>CSSLCH(|l|, |c|, |h|, optional |alpha|)</dfn> constructor
31003135
must, when invoked,
@@ -3122,6 +3157,8 @@ Issue: TODO add stringifiers
31223157
and set the corresponding internal slot to the result of that.
31233158
</div>
31243159

3160+
The {{CSSLab}} class represents the CSS ''lab()'' function.
3161+
31253162
<div algorithm="CSSLab()">
31263163
The <dfn constructor for=CSSLab>CSSLab(|l|, |a|, |b|, optional |alpha|)</dfn> constructor
31273164
must, when invoked,
@@ -3148,6 +3185,8 @@ Issue: TODO add stringifiers
31483185
and set the corresponding internal slot to the result of that.
31493186
</div>
31503187

3188+
The {{CSSColor}} class represents the CSS ''color()'' function.
3189+
31513190
<div algorithm="CSSColor()">
31523191
The <dfn constructor for=CSSColor>CSSColor(|colorspace|, |channels|, optional |alpha|)</dfn> constructor
31533192
must, when invoked,

0 commit comments

Comments
 (0)