About Magenta
Magenta (magenta) is a medium, vivid magenta with the hex code #ff00ff, or rgb(255, 0, 255). In HSL it sits at a hue of 300°, 100% saturation and 50% lightness. CSS also accepts the spelling fuchsia for exactly the same color. It is one of the 148 named colors every browser understands, so you can write color: magenta; instead of the hex value.
Using Magenta for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Magenta text on white | 3.14 : 1 | AA large text only |
| Magenta text on black | 6.70 : 1 | AA |
On a magenta background, use black text (6.70 : 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: magenta; /* or #ff00ff */
background-color: #ff00ff;
border: 1px solid rgb(255 0 255 / 50%);
}
Similar named colors
Deep Pink (#ff1493), Dark Violet (#9400d3), Medium Orchid (#ba55d3), Dark Orchid (#9932cc), Orchid (#da70d6), Blue Violet (#8a2be2).