@@ -2887,6 +2887,7 @@ interface CSSColorValue : CSSStyleValue {
2887
2887
CSSLCH toLCH();
2888
2888
CSSLab toLab();
2889
2889
CSSColor toColor(CSSKeywordish colorspace);
2890
+ CSSDeviceCMYK toDeviceCMYK();
2890
2891
2891
2892
[Exposed=Window] static CSSColorValue parse(USVString cssText);
2892
2893
};
@@ -2934,6 +2935,17 @@ interface CSSColorValue : CSSStyleValue {
2934
2935
with TODO.
2935
2936
</div>
2936
2937
2938
+ <div algorithm="CSSColorValue.toDeviceCMYK()">
2939
+ The <dfn method for=CSSColorValue>toDeviceCMYK()</dfn> method
2940
+ of {{CSSColorValue}} object must,
2941
+ when called on |this|,
2942
+ convert |this| into an sRGB color,
2943
+ then [=naively convert from RGBA to CMYK=]
2944
+ and return a new {{CSSDeviceCMYK}} object
2945
+ with its {{CSSDeviceCMYK/c}} , {{CSSDeviceCMYK/m}} , {{CSSDeviceCMYK/y}} , {{CSSDeviceCMYK/k}} , and {{CSSDeviceCMYK/alpha}} internal slots
2946
+ set appropriately to represent that color.<
2947
+ /div>
2948
+
2937
2949
<div algorithm="CSSColorValue.parse()">
2938
2950
The <dfn method for=CSSColorValue>parse(|cssText|)</dfn> method,
2939
2951
when called,
@@ -3011,6 +3023,16 @@ interface CSSColor : CSSColorValue {
3011
3023
attribute CSSPercentishArray channels;
3012
3024
attribute CSSNumberish alpha;
3013
3025
};
3026
+
3027
+ [Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
3028
+ interface CSSDeviceCMYK : CSSColorValue {
3029
+ constructor(CSSNumberish c, CSSNumberish m, CSSNumberish y, CSSNumberish k, optional CSSNumberish alpha = 1);
3030
+ attribute CSSNumberish c;
3031
+ attribute CSSNumberish m;
3032
+ attribute CSSNumberish y;
3033
+ attribute CSSNumberish k;
3034
+ attribute CSSNumberish alpha;
3035
+ };
3014
3036
</xmp>
3015
3037
3016
3038
Issue: TODO add stringifiers
@@ -3221,6 +3243,35 @@ The {{CSSColor}} class represents the CSS ''color()'' function.
3221
3243
and set the corresponding internal slot to the result of that.
3222
3244
</div>
3223
3245
3246
+ The {{CSSDeviceCMYK}} class represents the CSS ''device-cmyk()'' function.
3247
+
3248
+ <div algorithm="CSSDeviceCMYK()">
3249
+ The <dfn constructor for=CSSDeviceCMYK>CSSDeviceCMYK(|c|, |m|, |y|, |k|, optional |alpha|)</dfn> constructor
3250
+ must, when invoked,
3251
+ perform the following steps:
3252
+
3253
+ 1. Let |c|, |m|, |y|, |k|, and |alpha|
3254
+ be replaced by the result of [=rectifying a percentish value=] .
3255
+
3256
+ 2. If |c|, |m|, |y|, |k|, and |alpha| don't all [=CSSNumericValue/match=] "percent",
3257
+ [=throw=] a {{TypeError}} .
3258
+
3259
+ 3. Return a new {{CSSDeviceCMYK}}
3260
+ with its {{CSSDeviceCMYK/c}} , {{CSSDeviceCMYK/m}} , {{CSSDeviceCMYK/y}} , {{CSSDeviceCMYK/k}} , and {{CSSLab/alpha}} internal slots
3261
+ set to |c|, |m|, |y|, |k|, and |alpha|.
3262
+ </div>
3263
+
3264
+ <div algorithm="CSSDeviceCMYK.c">
3265
+ The <dfn attribute for=CSSDeviceCMYK>c</dfn> ,
3266
+ <dfn attribute for=CSSDeviceCMYK>m</dfn> ,
3267
+ <dfn attribute for=CSSDeviceCMYK>y</dfn> ,
3268
+ <dfn attribute for=CSSDeviceCMYK>k</dfn> ,
3269
+ and <dfn attribute for=CSSDeviceCMYK>alpha</dfn> attributes of a {{CSSDeviceCMYK}} value
3270
+ must, on setting to a new value |val|,
3271
+ [=rectify a percentish value=] from |val|
3272
+ and set the corresponding internal slot to the result of that.
3273
+ </div>
3274
+
3224
3275
<div algorithm>
3225
3276
To <dfn export>rectify a percentish value</dfn> |num|,
3226
3277
perform the following steps:
0 commit comments