About Purple
Purple (purple) is a dark, vivid magenta with the hex code #800080, or rgb(128, 0, 128). In HSL it sits at a hue of 300°, 100% saturation and 25% lightness. It is one of the 148 named colors every browser understands, so you can write color: purple; instead of the hex value.
Using Purple for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Purple text on white | 9.42 : 1 | AAA |
| Purple text on black | 2.23 : 1 | fails |
On a purple background, use white text (9.42 : 1). WCAG asks for at least 4.5 : 1 for body text and 3 : 1 for large text. Check other pairs with the Contrast Checker.
CSS
.element {
color: purple; /* or #800080 */
background-color: #800080;
border: 1px solid rgb(128 0 128 / 50%);
}
Similar named colors
Dark Magenta (#8b008b), Indigo (#4b0082), Rebecca Purple (#663399), Medium Violet Red (#c71585), Dark Slate Blue (#483d8b), Dark Violet (#9400d3).