#EE82EE — Violet

Violet is the CSS named color #EE82EE — rgb(238, 130, 238), hsl(300, 76%, 72%). Its relative luminance is 0.403, giving 2.32:1 against white and 9.06:1 against black, so it works as a text color on black.

Violet in every notation

HEX#EE82EE
RGBrgb(238, 130, 238)
HSLhsl(300, 76%, 72%)
Relative luminance0.4032
Contrast on white2.32:1 AA fail
Contrast on black9.06:1 AA pass

Tints and shades of violet

#FCECFC
#F9D3F9
#F5B4F5
#F199F1
#EE82EE
#CA6FCA
#A258A2
#774177
#4C2A4C

Built by mixing violet 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 violet?

violet is #EE82EE, which is rgb(238, 130, 238) and hsl(300, 76%, 72%). It is one of the 148 CSS named colors defined by the CSS Color Module Level 4.

Is violet light or dark?

Violet has a relative luminance of 0.403 on a 0–1 scale, so it is a dark color. Against white it scores 2.32:1; against black, 9.06:1.

Can I use violet for text?

violet reaches 9.06:1 against black, which clears WCAG 2.2 AA for normal text (4.5:1) at any size.