Basic color spaces: HEX, RGB, HSL, and Alpha
- CSS Colors Module has reached Level 4
- Alpha can be added directly to RGB through
/
, such asrgb(255 0 0 / 0.5)
- New color spaces added: Display P3, CIELAB, Oklab
- CIELAB:
lab(87.6 125 104)
lch(54.3 107 40.9deg)
- Oklab:
oklch(0.93 0.39 28deg)
- HWB:
hwb(0deg 0% 0%)
- CIELAB:
- General:
color()
, such as:color(display-p3 0 1 0)
color(rec2020 0 0 1)
color(srgb 0 0 1)
- Gradients can select color spaces and set transition direction, such as:
linear-gradient( to right in hsl longer hue, hsl(39deg 100% 50%), hsl(60deg 100% 50%) )