- From: Koutaro Mukai via GitHub <noreply@w3.org>
- Date: Sat, 16 May 2026 02:59:08 +0000
- To: public-css-archive@w3.org
u1f992 has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-color-5] `<color-interpolation-method>` between `device-cmyk()` colors should have a special value for interpolating in physical ink quantities ==
The current draft converts `device-cmyk()` in gradients (and similar contexts) to a Lab value, or to a naively-converted sRGB value. This throws away the physical ink quantity, so a gradient that interpolates in ink quantities cannot be expressed.
https://github.com/w3c/csswg-drafts/blob/3317e61fe2d6744744f69ee6f43994f6f9696455/css-color-5/Overview.bs#L2638-L2660
For example, a gradient from C0 to C100:
```css
div {
background: linear-gradient(device-cmyk(0 0 0 0), device-cmyk(1 0 0 0));
}
```
A naive reading expects this to interpolate in ink quantities, like the equivalent PDF shading:
```
5 0 obj
<< /ShadingType 2 /ColorSpace /DeviceCMYK
/Coords [50 450 450 450] /Domain [0 1]
/Function 6 0 R /Extend [true true] >>
endobj
6 0 obj
<< /FunctionType 2 /Domain [0 1]
/C0 [0 0 0 0] /C1 [1 0 0 0] /N 1 >>
endobj
```
But per the current draft, without an `@color-profile device-cmyk` rule, `device-cmyk()` in a gradient is converted to a naive RGB value. So conceptually the example above behaves like the example below.
Color-managing this `rgb(1 1 1)` → `rgb(0 1 1)` gradient in sRGB and separating it back to CMYK obviously produces non-zero M, Y, and K along the way, which is not a valid representation of `device-cmyk(0 0 0 0)` → `device-cmyk(1 0 0 0)`.
Even with `@color-profile device-cmyk` defined (so the endpoints become `lab()`), the ink quantities are still gone.
```css
div {
background: linear-gradient(rgb(1 1 1), rgb(0 1 1));
/* background: linear-gradient(lab(...), lab(...)) */
}
```
I propose introducing a special `device-cmyk` value for `<color-interpolation-method>`, valid only between `device-cmyk()` colors:
```css
div {
background: linear-gradient(in device-cmyk, device-cmyk(0 0 0 0), device-cmyk(1 0 0 0));
}
```
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13934 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 16 May 2026 02:59:09 UTC