Favorites

device-cmyk() CSS Function

device-cmyk()
CSS FunctionThis function is not supported by modern browsers.
Updated 21st November 2026

The device-cmyk() function describes a color by its cyan, magenta, yellow and black ink amounts, for print. No browser supports it yet.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

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

<div class="wrap">
<h1>CSS device-cmyk() examples</h1>
<div class="grid">
<div class="card">
<div class="sw cyan"></div>
<div class="label">device-cmyk(1 0 0 0)</div>
</div>
<div class="card">
<div class="sw magenta"></div>
<div class="label">device-cmyk(0 1 0 0)</div>
</div>
<div class="card">
<div class="sw yellow"></div>
<div class="label">device-cmyk(0 0 1 0)</div>
</div>
<div class="card">
<div class="sw black"></div>
<div class="label">device-cmyk(0 0 0 1)</div>
</div>
</div>
<div class="status"></div>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
margin: 24px;
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
background: #f5f7fb;
color: #102a43;
}

.wrap {
max-width: 860px;
margin: 0 auto;
}

h1 {
font-size: 20px;
margin: 0 0 16px;
}

.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 16px;
}

.card {
background: #fff;
border-radius: 12px;
padding: 16px;
box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
font-size: 12px;
color: #486581;
margin-top: 10px;
word-break: break-word;
}

.note {
font-size: 13px;
color: #486581;
margin-top: 14px;
}

/* device-cmyk() examples */
.sw {
height: 90px;
border-radius: 8px;
border: 1px solid rgba(16, 42, 67, 0.08);
}

/* Each swatch shows an RGB fallback; browsers that support
device-cmyk() would use the second declaration. */
.cyan { background: #00aeef; background: device-cmyk(1 0 0 0); }
.magenta { background: #ec008c; background: device-cmyk(0 1 0 0); }
.yellow { background: #fff200; background: device-cmyk(0 0 1 0); }
.black { background: #231f20; background: device-cmyk(0 0 0 1); }

.status {
margin-top: 16px;
padding: 10px 14px;
border-radius: 8px;
background: #fef3c7;
font-size: 13px;
}

.status::after { content: "device-cmyk() is not supported in this browser, so RGB fallbacks are shown."; }

@supports (color: device-cmyk(0 0 0 1)) {
.status { background: #dcfce7; }
.status::after { content: "device-cmyk() is supported in this browser."; }
}
Open in editor

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.

This function is not supported by modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.