#800080 — Purple

Purple is the CSS named color #800080 — rgb(128, 0, 128), hsl(300, 100%, 25%). Its relative luminance is 0.061, giving 9.42:1 against white and 2.23:1 against black, so it works as a text color on white.

Purple in every notation

HEX#800080
RGBrgb(128, 0, 128)
HSLhsl(300, 100%, 25%)
Relative luminance0.0615
Contrast on white9.42:1 AA pass
Contrast on black2.23:1 AA fail

Tints and shades of purple

#ECD9EC
#D3A6D3
#B366B3
#972E97
#800080
#6D006D
#570057
#400040
#290029

Built by mixing purple toward white (four steps) and toward black (four steps) while keeping the hue. Use the shades generator for a different step count or to add harmony sets.

Similar CSS colors

Closest by CIELAB distance (ΔE76). For perceptual matching in a design system, compare in OKLab before locking a token.

Frequently asked questions

What is the hex code for purple?

purple is #800080, which is rgb(128, 0, 128) and hsl(300, 100%, 25%). It is one of the 148 CSS named colors defined by the CSS Color Module Level 4.

Is purple light or dark?

Purple has a relative luminance of 0.061 on a 0–1 scale, so it is a dark color. Against white it scores 9.42:1; against black, 2.23:1.

Can I use purple for text?

purple reaches 9.42:1 against white, which clears WCAG 2.2 AA for normal text (4.5:1) at any size.