Color Format Cheatsheet
Forms
14
css color
Visible
14
all
Filter
—
query
Status
ready
live
input · color
HEX
#3b82f6
RGB
rgb(59, 130, 246)
RGBA (legacy)
rgba(59, 130, 246, 0.5)
HSL
hsl(217, 91%, 60%)
HSLA
hsla(217, 91%, 60%, 0.5)
HWB
hwb(217 23% 4%)
OKLCH
oklch(62% 0.2 254)
OKLAB
oklab(62% -0.05 -0.18)
LCH (CIE)
lch(60% 65 270)
LAB (CIE)
lab(60% -10 -55)
color()
color(display-p3 0.23 0.51 0.96)
Named
cornflowerblue
currentColor
currentColor
transparent
transparent
output · preview
Most common. #RGB / #RGBA / #RRGGBB / #RRGGBBAA all valid.
Modern syntax accepts space-separated and slash for alpha: rgb(59 130 246 / 0.5).
Comma syntax. Modern equivalent uses rgb() with slash.
Hue (0-360deg) / saturation% / lightness%. Intuitive for tweaks.
HSL with alpha. Comma syntax.
Hue + whiteness + blackness. Mirrors how painters mix.
Perceptually uniform. Best for modern design systems.
Cartesian version of OKLCH (a/b axes).
Older perceptual model, mostly superseded by OKLCH.
Cartesian CIE LAB. Less uniform than OKLAB.
Wide-gamut color spaces — display-p3, rec2020, srgb-linear, etc.
148 CSS named colors. Use only for examples / quick prototypes.
Inherits the parent's color value.
Shorthand for rgba(0,0,0,0).