The CSS colors module defines colors, color types, color blending, opacity, and how you can apply these colors and effects to HTML content.
While this module has only two CSS properties, color and opacity, over 20 CSS and SVG properties, CSS images, at-rules, and @media rules depend on these two properties.
The color syntax converter below shows the values of the currently selected color in red-green-blue (RGB), hexadecimal (HEX), hue, saturation, and lightness (HSL), and hue, whiteness, and blackness (HWB) CSS color formats. All the RGB, HEX, HSL, and HWB color values here, while written differently, represent the same color value.
Selecting a color via the color picker and an opacity via the slider updates the RGB, HEX, HSL, and HWB values. When you choose a new color or opacity value, the color of the background and the slider update via the CSS properties background-color and accent-color, respectively.
To see the code for this color syntax converter, view the source on GitHub.
The CSS colors module also introduces the @color-profile at-rule, along with its components, rendering-intent and src descriptors. Currently, no browsers support these features.
color-mix()contrast-color()light-dark()The CSS color module also introduces the device-cmyk() and contrast-color() functions. Currently, no browsers support these features.
The CSS color module also introduces the CSSColorProfileRule interface. Currently, no browsers support this feature.
A guide to using CSS to apply color to a variety of types of content, including all CSS properties that accept <color> as a value.
An overview of color spaces and the different <color> functional notations available in CSS.
Color theory and resources, including finding the right colors to create an accessible color palette, contrast, and printing in color.
This article explains relative CSS color syntax, shows what the different options are, and looks at some illustrative examples.
A tool that lets you pick a color in the sRGB color space and converts it between various CSS color formats, helping you understand the syntax of the different color notations.
Color perception and using colors with color insensitive (color blind) users, reduced vision users and users with vestibular disorders or other neurological disorders in mind.
Explanation of contrast requirements between background and foreground content to ensure legibility.
color attribute@font-palette-values at-rule override-colors descriptor@color-profile at-rulecolor-gamut @media featureforced-colors @media feature| Specification |
|---|
| CSS Color Module Level 4> |
| CSS Color Module Level 5> |
print-color-adjust property.<gradient> images are defined.VideoColorSpace interface<feColorMatrix> element
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_colors