About violet
A vivid blue-purple at the far end of the rainbow. Its hex code is #7F00FF, which is rgb(127, 0, 255): 127 red, 0 green and 255 blue on a scale of 0 to 255.
Other values you'll see for violet: #EE82EE (the CSS violet, a light pink-purple).
Violet is a cool color.
Violet tints and shades
Lighter tints (mixed with white) and darker shades (mixed with black) of violet. Click any of them to copy its hex code.
Colors that go with violet
Complementary
The opposite color on the color wheel, for strong contrast.
Analogous
Neighbors on the color wheel, for a calm, matching look.
Triadic
Three colors evenly spaced around the wheel, for a balanced, lively palette.
Split complementary
The two colors either side of the complement: contrast without clashing.
Text on violet
White text
Black text
For readable text, WCAG asks for a contrast ratio of at least 4.5:1 (3:1 for large text). White text is the better choice on violet. Test other combinations with the contrast checker.
Using violet in CSS
.element {
color: #7F00FF;
background-color: rgb(127 0 255);
border-color: hsl(270 100% 50%);
}
Frequently asked questions
What is the hex code for violet?
Violet is #7F00FF. In RGB it's rgb(127, 0, 255), and in HSL it's hsl(270, 100%, 50%).
What colors go with violet?
Its complementary color is #80FF00, which gives strong contrast. For a softer look, use analogous colors #0000FF and #FE00FF. Violet also pairs well with white.
Is violet warm or cool?
Violet is a cool color.
Should I use white or black text on violet?
Use white text. Its contrast ratio on violet is 6.27:1, versus 3.34:1 for black.
Similar colors
- Indigo#4B0082rgb(75, 0, 130)
- Mauve#E0B0FFrgb(224, 176, 255)
- Magenta#FF00FFrgb(255, 0, 255)
- Blue#0000FFrgb(0, 0, 255)
- Navy blue#000080rgb(0, 0, 128)
- Purple#800080rgb(128, 0, 128)
See all popular colors · All HTML color names · Open violet in the color picker