Color Formats Explained
Different color formats serve different purposes. Here's what each offers.
HEX Colors
Hexadecimal representation of RGB values.
#RRGGBB or #RGB (shorthand)
#FF5733 = RGB(255, 87, 51)
#F00 = #FF0000 = RGB(255, 0, 0)
With alpha:
#FF573380 = 50% transparent
Best for: CSS, design tools, quick notation
RGB / RGBA
Red, Green, Blue values (0-255).
rgb(255, 87, 51)
rgba(255, 87, 51, 0.5) / 50% transparent /
/ Modern syntax /
rgb(255 87 51)
rgb(255 87 51 / 50%)
Best for: Programmatic color manipulation
HSL / HSLA
Hue, Saturation, Lightness - more intuitive!
hsl(14, 100%, 60%)
hsla(14, 100%, 60%, 0.5)
/ Hue: 0-360 (color wheel position)
Saturation: 0-100% (gray to vivid)
Lightness: 0-100% (black to white) /
Best for: Creating color variations, themes
HSL Color Wheel
0° = Red
60° = Yellow
120° = Green
180° = Cyan
240° = Blue
300° = Magenta
360° = Red (wraps around)
Modern: OKLCH
Perceptually uniform color space (CSS Color Level 4).
oklch(70% 0.15 180)
/ Lightness, Chroma, Hue /
Best for: Accessible color palettes, consistent perceived brightness