Widely available Supported across all major browsers. Safe to use in production.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
111
111
113
15
111
15
CSS type
color.mixed type parameters

Mix `<percentage>` and `<number>` in parameters

111
111
113
15
111
15
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (15)
Implementation note
  • Only supports `display-p3` and `srgb` predefined color profiles.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (15)
Implementation note
  • Only supports `display-p3` and `srgb` predefined color profiles.

Syntax

CSS
/* Display P3 color space */
.vivid {
  background-color: color(display-p3 1 0 0);
}

/* Explicit sRGB */
.srgb {
  color: color(srgb 0.5 0.2 0.8);
}

/* With transparency */
.p3-alpha {
  color: color(display-p3 0.2 0.8 0.4 / 0.9);
}

Live demo

Display-p3 Colorspace

color() function Display-p3 colorspace demo.

PreviewFullscreen

Srgb explicitspecified

color() function SRGB explicitspecified demo.

PreviewFullscreen

widecolorrange. vivid

color() function widecolorrange. vivid demo.

PreviewFullscreen

Use cases

  • Using color()

    The color() functional notation allows a color to be specified in a particular, specified color space rather than the implicit sRGB color space that most of the other color functions operate in.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Make sure visual changes are conveyed appropriately to assistive technology.