device-cmyk() CSS Function
The device-cmyk() function describes a color by its cyan, magenta, yellow and black ink amounts, for print. No browser supports it yet.
Description
The device-cmyk() CSS function describes a color using the four ink components used in printing: cyan, magenta, yellow and black (the "K" in CMYK). It is "device" CMYK because the values are meant to be sent directly to a particular printer or press, and the actual color produced depends on that device's inks and paper. It is mainly intended for print stylesheets and documents that are converted to PDF for professional printing.
Each component is a number from 0 to 1 or a percentage from 0% to 100%, giving the amount of that ink. device-cmyk(0 0 0 1) is full black ink and device-cmyk(0 0 0 0) is no ink, which shows the paper (white). An optional alpha value can be added after a slash. On screens, the browser has to convert the color to RGB using a simple formula, so the on-screen result is only an approximation of the printed color.
The function is defined in CSS Color Module Level 5, but no current web browser supports it. It is mostly used by print formatters such as PrinceXML or WeasyPrint. If you use it on the web, always give an RGB fallback first, because browsers ignore declarations they do not understand.
.logo-text {
color: #00a0e3; /* screen fallback */
color: device-cmyk(100% 30% 0% 0%); /* print color */
}
@media print {
h1 {
color: device-cmyk(0 0.9 0.85 0.1);
}
}
/* Test for support before relying on it */
@supports (color: device-cmyk(0 0 0 1)) {
.rich-black { color: device-cmyk(0.6 0.4 0.4 1); }
}
Syntax
device-cmyk() = device-cmyk( [ <number> | <percentage> | none ]{4} [ / [ <alpha-value> | none ] ]? )Values
- C (cyan)A <number> from 0 to 1 or a <percentage> from 0% to 100% for the amount of cyan ink.
- M (magenta)A <number> from 0 to 1 or a <percentage> for the amount of magenta ink.
- Y (yellow)A <number> from 0 to 1 or a <percentage> for the amount of yellow ink.
- K (black)A <number> from 0 to 1 or a <percentage> for the amount of black ink.
- alphaOptional. An <alpha-value> after a slash (/) from 0 to 1, or a percentage.
Example
Browser Support
The following information will show you the current browser support for the CSS device-cmyk() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





