blue violet color code
The hex code for blue violet is #8A2BE2, which is rgb(138, 43, 226) in RGB and cmyk(39%, 81%, 0%, 11%) in CMYK. It's a medium, rich purple. It is a built-in CSS colour, so you can also write it as “blueviolet”.
Build a full palette from it: open in the palette generator.
Move the sliders to find a lighter, darker or softer blue violet; the codes update as you go.
Blue Violet colour codes
| HEX | #8A2BE2 |
|---|---|
| RGB | rgb(138, 43, 226) |
| HSL | hsl(271, 76%, 53%) |
| HSV / HSB | hsv(271, 81%, 89%) |
| CMYK | cmyk(39%, 81%, 0%, 11%) |
| Decimal | 9055202 |
| CSS keyword | blueviolet |
About blue violet
Blue Violet sits at a hue of 271° on the colour wheel, with 76% saturation and 53% lightness. That makes it a colour that sits between warm and cool: greens and purples like this can be styled warm or cool depending on what you put next to them.
For text, white reads better on blue violet. Blue Violet as text on a white background has a contrast ratio of 5.95:1, which passes the WCAG AA rule for body text (4.5:1). On black it is 3.52:1, which fails AA for body text.
Tints and shades of blue violet
Tints mix blue violet with white and shades mix it with black, in 10% steps. They're the easiest way to get lighter backgrounds and darker hover or text colours that still match.
Colours that go with blue violet
Complementary — opposite on the colour wheel: maximum contrast
Analogous — neighbours 30° either side: calm and natural
Triadic — three hues 120° apart: lively but balanced
Split complementary — the two neighbours of the complement: contrast with less tension
Tetradic — four hues 90° apart: rich, use one as the main colour
Blue Violet text contrast
| Combination | Ratio | AA normal (4.5:1) | AA large (3:1) | AAA (7:1) |
|---|---|---|---|---|
| blue violet on white | 5.95:1 | pass | pass | fail |
| blue violet on black | 3.52:1 | fail | pass | fail |
Check blue violet against any other colour in the contrast checker.
How blue violet looks with colour blindness
Simulated with the Machado et al. (2009) model for the complete loss of one type of cone cell. Colour vision deficiency affects roughly 1 in 12 men and 1 in 200 women, most often as red-green colour blindness.
Use blue violet in code
.blue-violet {
color: blueviolet;
background-color: #8a2be2;
border-color: rgb(138, 43, 226);
}Frequently asked questions
What is the hex code for blue violet?
Blue Violet is #8A2BE2 (lowercase #8a2be2). It's the official value of the CSS keyword “blueviolet”.
What is blue violet in RGB, HSL and CMYK?
RGB: rgb(138, 43, 226). HSL: hsl(271, 76%, 53%). CMYK: cmyk(39%, 81%, 0%, 11%). CMYK is a simple conversion for reference; for professional printing, ask your printer for a matching ink or Pantone swatch.
What colours go with blue violet?
Its complementary colour is #83E22B (close to lawn green), which gives the strongest contrast. For a calmer look, use the analogous colours #2F2BE2 and #E22BDE, or the triadic pair #E28A2B and #2BE28A. Tints and shades of blue violet itself always work together.
Is blue violet a warm or cool colour?
Blue Violet has a hue of 271°, which makes it neither clearly warm nor cool.
Should I use black or white text on blue violet?
White. Black text on blue violet has a contrast ratio of 3.52:1 and white text has 5.95:1. WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.
How do I use blue violet in CSS?
Write color: blueviolet; or color: #8a2be2; — both give the same colour. Named colours work in every browser.