Skip to content

CSS named color

DarkMagenta #8B008B

DarkMagenta (CSS keyword darkmagenta) has the hex code #8B008B and the RGB value rgb(139, 0, 139): a dark, vivid purple.

DarkMagenta#8B008B

Dark magenta (#8b008b) is the X11 dark variant of magenta and is very close to purple (#800080), just slightly brighter.

Color codes for DarkMagenta

Color codes for DarkMagenta
CSS keyworddarkmagenta
HEX#8B008B
RGBrgb(139, 0, 139)
HSLhsl(300, 100%, 27%)
HWBhwb(300 0% 45%)
OKLCHoklch(44.7% 0.205 328.4)
CMYK (naive, no ICC profile)cmyk(0%, 100%, 0%, 45%)
Decimal9,109,643
Hue familyPurples and violets

Contrast and accessibility

On darkmagenta, white text has a contrast ratio of 8.49:1 and passes AAA at any text size; black text reaches 2.47: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 darkmagenta2.47:1FailFailFailFail17.0
White text on darkmagenta8.49:1PassPassPassPass−91.7
Darkmagenta text on white8.49:1PassPassPassPass87.0
Darkmagenta text on black2.47:1FailFailFailFail−15.1

Tints and shades

Each step mixes darkmagenta with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, darkmagenta, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #910d91
  2. 15%
    #9c269c
  3. 25%
    #a840a8
  4. 35%
    #b459b4
  5. 45%
    #bf73bf
  6. 55%
    #cb8ccb
  7. 65%
    #d6a6d6
  8. 75%
    #e2bfe2
  9. 85%
    #eed9ee
  10. 95%
    #f9f2f9

Shades (mixed with black)

  1. 5%
    #840084
  2. 15%
    #760076
  3. 25%
    #680068
  4. 35%
    #5a005a
  5. 45%
    #4c004c
  6. 55%
    #3f003f
  7. 65%
    #310031
  8. 75%
    #230023
  9. 85%
    #150015
  10. 95%
    #070007

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, darkmagenta's complementary color is #006A13 (close to darkgreen), its analogous colors are #6725B3 and #A10053, and its triadic partners are #6D4F00 and #006270. For text on top, white gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#006a13
Analogous−30°, +30°#6725b3#a10053
Triadic+120°, +240°#6d4f00#006270
Split-complementary+150°, +210°#4f5c00#006655

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?

DarkMagenta 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
purple#8000802.8
rebeccapurple#6633999.1
darkviolet#9400d311.5

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
fuchsia-800#8a01941.6
fuchsia-900#7213785.9
fuchsia-700#a800b78.7

Code snippets

CSS
.element {
  color: darkmagenta;
  background-color: #8b008b;
  border-color: rgb(139 0 139);
  outline-color: oklch(44.7% 0.205 328.4);
}
Tailwind CSS
<div class="bg-[#8b008b] text-white">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-darkmagenta: #8b008b;
}
/* then use bg-darkmagenta, text-darkmagenta, border-darkmagenta */
SwiftUI
import SwiftUI

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

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

const darkmagenta = Color(0xFF8B008B);
Android XML
<!-- res/values/colors.xml -->
<color name="darkmagenta">#8B008B</color>

Frequently asked questions

What is the hex code for darkmagenta?
The hex code for darkmagenta is #8B008B. The same color is rgb(139, 0, 139), hsl(300, 100%, 27%) and oklch(44.7% 0.205 328.4), and in CSS you can also write the keyword darkmagenta directly.
Is darkmagenta a warm or cool color?
DarkMagenta 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 darkmagenta?
Rotating the hue in OKLCH while keeping lightness and chroma, darkmagenta's complementary color is #006A13 (close to darkgreen), its analogous colors are #6725B3 and #A10053, and its triadic partners are #6D4F00 and #006270. For text on top, white gives the higher contrast.
Can you use white text on darkmagenta?
White text on darkmagenta has a contrast ratio of 8.49:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 2.47:1 and fails AA even for large text. In APCA terms that is Lc −91.7 for white and Lc 17.0 for black.
What is the RGB value of darkmagenta?
DarkMagenta is rgb(139, 0, 139): red 139, green 0 and blue 139 on the 0 to 255 scale, or 54.5%, 0.0% and 54.5%. As a decimal integer it is 9109643.

Last reviewed by Arielton Oberek.