CSS named color

Firebrick #B22222

The CSS keyword firebrick is #B22222. It is a vivid red in the red family. In OKLCH it sits at lightness 0.497, chroma 0.180 and hue 26.8°.

Relative luminance
0.1072
OKLCH L · C · h
0.497 · 0.180 · 26.8
Best text
White 6.67:1
Hue family
Red

#B22222 color codes

HEX
#B22222
RGB
rgb(178, 34, 34)
HSL
hsl(0, 68%, 42%)
OKLCH
oklch(0.497 0.180 26.8)
OKLab
oklab(0.497 0.160 0.081)
CIELAB (D65)
L* 39.12, a* 55.92, b* 37.65
XYZ (D65)
X 19.22, Y 10.73, Z 2.57
CMYK (naive)
cmyk(0%, 81%, 81%, 30%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #B22222 accessible?

White text on it reaches 6.67:1, passing AA. Black text manages only 3.14:1, enough for large text only.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    3.14:1

    • AA fails
    • AA large passes
    • AAA fails
    • APCA Lc +22
  • White text on it

    6.67:1

    • AA passes
    • AA large passes
    • AAA fails
    • APCA Lc −86
  • As text on black

    3.14:1

    • AA fails
    • AA large passes
    • AAA fails
    • APCA Lc −20
  • As text on white

    6.67:1

    • AA passes
    • AA large passes
    • AAA fails
    • APCA Lc +81

Nearest versions that pass 4.5:1

  • For text on white

    #B22222 6.67:1

    It already reaches 6.67:1 on white, so no change is needed.

  • For text on black

    #D0423C 4.52:1

    Lightening its OKLCH lightness from 0.50 to 0.58 reaches 4.52:1 on black, keeping the hue.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #B22222 live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #B22222

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #B22222 sits at step 700.

  1. 50#FFF2F0
    White
    1.09
    Black
    19.21
  2. 100#FFE4E0
    White
    1.20
    Black
    17.42
  3. 200#FFC8C1
    White
    1.47
    Black
    14.28
  4. 300#FFA096
    White
    1.95
    Black
    10.72
  5. 400#FC6E63
    White
    2.78
    Black
    7.54
  6. 500#DD4F47
    White
    3.97
    Black
    5.28
  7. 600#C13430
    White
    5.52
    Black
    3.80
  8. 700This color#B22222
    White
    6.67
    Black
    3.14
  9. 800#7D0009
    White
    11.19
    Black
    1.87
  10. 900#540004
    White
    15.23
    Black
    1.37
  11. 950#320001
    White
    18.48
    Black
    1.13

Under each step, white and black text on it; a bold figure passes 4.5:1.

Gamut

How vivid #B22222 can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.202; #B22222 uses 89% of it. Display P3, which many recent phones and laptops show, reaches 0.228 there: 13% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.180
sRGB edge
0.202
Display P3 edge
0.228
Rec. 2020 edge
0.243
Dominant wavelength
611 nm
Excitation purity
78%
Chromaticity
x 0.5911, y 0.3299
  • This color#B22222
  • Most vivid in sRGB#BA0013
  • Most vivid in Display P3oklch(0.497 0.228 26.8)

On a screen without Display P3 the last tile shows the sRGB edge instead.

Use the wider color where screens show it
.accent {
  color: #b22222;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0.6997 0 0.065); }
}

Mixing

Mixing #B22222

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#D99191
  • OKLab50%#E1988F
  • OKLCH50%#E1988F

Black #000000

  • sRGB50%#591111
  • OKLab50%#430707
  • OKLCH50%#430707

Its complement #00707B

  • sRGB50%#59494F
  • OKLab50%#7B5854
  • OKLCH50%#5F6A00
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #b22222, white);
color: color-mix(in oklch, #b22222 50%, white);

In use

#B22222 in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:16.67:1 Passes
  • Link and body-size textText, 4.5:16.67:1 Passes
  • Large headingLarge text, 3:16.67:1 Passes
  • Icons, borders and focus ringsNon-text, 3:16.67:1 Passes

Dark page

  • Button labelText, 4.5:16.67:1 Passes
  • Link and body-size textText, 4.5:12.80:1 Fails
  • Large headingLarge text, 3:12.80:1 Fails
  • Icons, borders and focus ringsNon-text, 3:12.80:1 Fails

For text on this page, the nearest shade that passes is #DB4C45 4.57:1

Color vision

How #B22222 looks with color blindness

Deuteranopia changes it most, ΔE2000 37.4; tritanopia changes it least, 3.5.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #514820 ΔE2000 33.3

    Distinct

    Reads as dark muted brown

  • Deuteranopia

    No working green (medium-wavelength) cones

    #74671B ΔE2000 37.4

    Distinct

    Reads as muted brown

  • Tritanopia

    No working blue (short-wavelength) cones

    #C40024 ΔE2000 3.5

    Close match

    Reads as vivid red

  • Achromatopsia

    No cone color vision; lightness only

    #5C5C5C ΔE2000 27.0

    Distinct

    Reads as dark gray

Pairing check

Checked against its complement, #00707B. Their lightness contrast is only 1.14:1, so where hue collapses, add a label, icon or pattern.

VisionThe pairΔE2000Verdict
Normal vision#B22222 · #00707B48.7Stays distinct
Protanopia#514820 · #656B7C28.9Stays distinct
Deuteranopia#74671B · #57617B36.3Stays distinct
Tritanopia#C40024 · #00767355.8Stays distinct
Achromatopsia#5C5C5C · #6565653.3Easily confused

Harmony

Color harmonies for #B22222

Its complement is #00707B, a muted teal, on the cool side of the wheel.

Hue rotations in OKLCH, mapped into sRGB by trimming chroma so hue and lightness stay put.

Open the Harmony Studio
  • Base#B22222
  • Complement#00707B

Complementary

Open in Harmony Studio
  • −30°#AA2164
  • Base#B22222
  • +30°#944D00
  • Base#B22222
  • +120°#007728
  • +240°#3456C7
  • Base#B22222
  • +150°#007361
  • +210°#006A98

Split-complementary

Open in Harmony Studio

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-firebrick: #b22222;
}

Tailwind config

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        firebrick: '#b22222',
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  --color-firebrick: oklch(0.497 0.180 26.8);
}

Design token (W3C DTCG)

{
  "color": {
    "firebrick": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.698, 0.1333, 0.1333],
        "hex": "#b22222"
      },
      "$description": "CSS named color firebrick"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let firebrick = Color(.sRGB, red: 0.698, green: 0.133, blue: 0.133, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Firebrick = Color(0xFFB22222)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #B22222 in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.