CSS named color
Magenta #FF00FF
Magenta (CSS keyword magenta) has the hex code #FF00FF and the RGB value rgb(255, 0, 255): a light, vivid magenta.
Magenta is identical to fuchsia (#ff00ff). The name comes from a 19th-century aniline dye renamed after the Battle of Magenta (1859), and magenta is the subtractive primary in CMYK printing.
The keyword fuchsia has exactly the same value (#FF00FF); browsers treat them as the same color.
Color codes for Magenta
| CSS keyword | magenta |
|---|---|
| HEX | #FF00FF |
| RGB | rgb(255, 0, 255) |
| HSL | hsl(300, 100%, 50%) |
| HWB | hwb(300 0% 0%) |
| OKLCH | oklch(70.2% 0.322 328.4) |
| CMYK (naive, no ICC profile) | cmyk(0%, 100%, 0%, 0%) |
| Decimal | 16,711,935 |
| Hue family | Purples and violets |
| Same value as | fuchsia |
Contrast and accessibility
On magenta, black text has a contrast ratio of 6.69:1 and passes AA for normal text; white text reaches 3.13:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on magenta | 6.69:1 | Pass | Pass | Fail | Pass | 48.5 |
| White text on magenta | 3.13:1 | Fail | Pass | Fail | Fail | −60.9 |
| Magenta text on white | 3.13:1 | Fail | Pass | Fail | Fail | 55.6 |
| Magenta text on black | 6.69:1 | Pass | Pass | Fail | Pass | −46.2 |
Tints and shades
Each step mixes magenta with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, magenta, white 25%) in CSS.
Tints (mixed with white)
- 5%
#ff0dff - 15%
#ff26ff - 25%
#ff40ff - 35%
#ff59ff - 45%
#ff73ff - 55%
#ff8cff - 65%
#ffa6ff - 75%
#ffbfff - 85%
#ffd9ff - 95%
#fff2ff
Shades (mixed with black)
- 5%
#f200f2 - 15%
#d900d9 - 25%
#bf00bf - 35%
#a600a6 - 45%
#8c008c - 55%
#730073 - 65%
#590059 - 75%
#400040 - 85%
#260026 - 95%
#0d000d
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, magenta's complementary color is #00C33B (close to limegreen), its analogous colors are #B27AFF and #FF469D, and its triadic partners are #C89700 and #00B6CD. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #00c33b |
| Analogous | −30°, +30° | #b27aff#ff469d |
| Triadic | +120°, +240° | #c89700#00b6cd |
| Split-complementary | +150°, +210° | #95ad00#00bca0 |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
Magenta sits on the boundary: its hue of 300° on the HSL wheel is a magenta, which reads warm next to blues and cool next to reds and oranges.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| orchid | #da70d6 | 14.1 |
| mediumorchid | #ba55d3 | 14.8 |
| violet | #ee82ee | 14.9 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| fuchsia-500 | #e12afb | 5.5 |
| fuchsia-400 | #ed6aff | 9.8 |
| fuchsia-600 | #c800de | 11.8 |
Code snippets
.element {
color: magenta;
background-color: #ff00ff;
border-color: rgb(255 0 255);
outline-color: oklch(70.2% 0.322 328.4);
}<div class="bg-[#ff00ff] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-magenta: #ff00ff;
}
/* then use bg-magenta, text-magenta, border-magenta */import SwiftUI
extension Color {
static let magenta = Color(red: 1.000, green: 0.000, blue: 1.000)
}import androidx.compose.ui.graphics.Color
val Magenta = Color(0xFFFF00FF)import 'package:flutter/material.dart';
const magenta = Color(0xFFFF00FF);<!-- res/values/colors.xml -->
<color name="magenta">#FF00FF</color>Frequently asked questions
- What is the hex code for magenta?
- The hex code for magenta is #FF00FF. The same color is rgb(255, 0, 255), hsl(300, 100%, 50%) and oklch(70.2% 0.322 328.4), and in CSS you can also write the keyword magenta directly.
- Is magenta a warm or cool color?
- Magenta sits on the boundary: its hue of 300° on the HSL wheel is a magenta, which reads warm next to blues and cool next to reds and oranges.
- What colors go with magenta?
- Rotating the hue in OKLCH while keeping lightness and chroma, magenta's complementary color is #00C33B (close to limegreen), its analogous colors are #B27AFF and #FF469D, and its triadic partners are #C89700 and #00B6CD. For text on top, black gives the higher contrast.
- Can you use white text on magenta?
- White text on magenta has a contrast ratio of 3.13:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 6.69:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −60.9 for white and Lc 48.5 for black.
- Is magenta the same as fuchsia?
- Yes. Both keywords are #FF00FF (rgb(255, 0, 255)). CSS Color 4 keeps both for compatibility, so use whichever your codebase already uses.
Last reviewed by Arielton Oberek.