Skip to content

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#FF00FF

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

Color codes for Magenta
CSS keywordmagenta
HEX#FF00FF
RGBrgb(255, 0, 255)
HSLhsl(300, 100%, 50%)
HWBhwb(300 0% 0%)
OKLCHoklch(70.2% 0.322 328.4)
CMYK (naive, no ICC profile)cmyk(0%, 100%, 0%, 0%)
Decimal16,711,935
Hue familyPurples and violets
Same value asfuchsia

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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on magenta6.69:1PassPassFailPass48.5
White text on magenta3.13:1FailPassFailFail−60.9
Magenta text on white3.13:1FailPassFailFail55.6
Magenta text on black6.69:1PassPassFailPass−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)

  1. 5%
    #ff0dff
  2. 15%
    #ff26ff
  3. 25%
    #ff40ff
  4. 35%
    #ff59ff
  5. 45%
    #ff73ff
  6. 55%
    #ff8cff
  7. 65%
    #ffa6ff
  8. 75%
    #ffbfff
  9. 85%
    #ffd9ff
  10. 95%
    #fff2ff

Shades (mixed with black)

  1. 5%
    #f200f2
  2. 15%
    #d900d9
  3. 25%
    #bf00bf
  4. 35%
    #a600a6
  5. 45%
    #8c008c
  6. 55%
    #730073
  7. 65%
    #590059
  8. 75%
    #400040
  9. 85%
    #260026
  10. 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.

Color harmonies
HarmonyRotationColor
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

Nearest CSS named colors
ColorHEXΔE OK
orchid#da70d614.1
mediumorchid#ba55d314.8
violet#ee82ee14.9

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
fuchsia-500#e12afb5.5
fuchsia-400#ed6aff9.8
fuchsia-600#c800de11.8

Code snippets

CSS
.element {
  color: magenta;
  background-color: #ff00ff;
  border-color: rgb(255 0 255);
  outline-color: oklch(70.2% 0.322 328.4);
}
Tailwind CSS
<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 */
SwiftUI
import SwiftUI

extension Color {
  static let magenta = Color(red: 1.000, green: 0.000, blue: 1.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Magenta = Color(0xFFFF00FF)
Flutter
import 'package:flutter/material.dart';

const magenta = Color(0xFFFF00FF);
Android XML
<!-- 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.