CSS named color

Green #008000

The CSS keyword green is #008000. It is a vivid green in the green family. In OKLCH it sits at lightness 0.520, chroma 0.177 and hue 142.5°.

Relative luminance
0.1544
OKLCH L · C · h
0.520 · 0.177 · 142.5
Best text
White 5.13:1
Hue family
Green

#008000 color codes

HEX
#008000
RGB
rgb(0, 128, 0)
HSL
hsl(120, 100%, 25%)
OKLCH
oklch(0.520 0.177 142.5)
OKLab
oklab(0.520 -0.140 0.108)
CIELAB (D65)
L* 46.23, a* -51.70, b* 49.90
XYZ (D65)
X 7.72, Y 15.44, Z 2.57
CMYK (naive)
cmyk(100%, 0%, 100%, 50%)

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 #008000 accessible?

White text on it reaches 5.13:1, passing AA. Black text manages only 4.08: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

    4.08:1

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

    5.13:1

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

    4.08:1

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

    5.13:1

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

Nearest versions that pass 4.5:1

  • For text on white

    #008000 5.13:1

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

  • For text on black

    #148811 4.55:1

    Lightening its OKLCH lightness from 0.52 to 0.54 reaches 4.55:1 on black, keeping the hue.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #008000 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 #008000

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

  1. 50#E1FFDE
    White
    1.07
    Black
    19.56
  2. 100#BFFFB9
    White
    1.15
    Black
    18.21
  3. 200#98F191
    White
    1.37
    Black
    15.32
  4. 300#79D872
    White
    1.76
    Black
    11.87
  5. 400#57BC51
    White
    2.40
    Black
    8.71
  6. 500#359F31
    White
    3.41
    Black
    6.15
  7. 600This color#008000
    White
    5.13
    Black
    4.08
  8. 700#006C00
    White
    6.67
    Black
    3.14
  9. 800#004F00
    White
    9.91
    Black
    2.11
  10. 900#003400
    White
    14.08
    Black
    1.49
  11. 950#001D00
    White
    17.86
    Black
    1.17

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

Gamut

How vivid #008000 can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.177; #008000 uses 100% of it. Display P3, which many recent phones and laptops show, reaches 0.209 there: 18% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.177
sRGB edge
0.177
Display P3 edge
0.209
Rec. 2020 edge
0.217
Dominant wavelength
549 nm
Excitation purity
73%
Chromaticity
x 0.3000, y 0.6000
  • This color#008000
  • Most vivid in sRGB#008000
  • Most vivid in Display P3oklch(0.520 0.209 142.5)

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

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

Mixing

Mixing #008000

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%#80C080
  • OKLab50%#90C08C
  • OKLCH50%#90C08C

Black #000000

  • sRGB50%#004000
  • OKLab50%#002E00
  • OKLCH50%#002E00

Its complement #963BA3

  • sRGB50%#4B5E52
  • OKLab50%#696969
  • OKLCH50%#00729C
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #008000, white);
color: color-mix(in oklch, #008000 50%, white);

In use

#008000 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:15.13:1 Passes
  • Link and body-size textText, 4.5:15.13:1 Passes
  • Large headingLarge text, 3:15.13:1 Passes
  • Icons, borders and focus ringsNon-text, 3:15.13:1 Passes

Dark page

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

For text on this page, the nearest shade that passes is #23911F 4.58:1

Color vision

How #008000 looks with color blindness

Achromatopsia changes it most, ΔE2000 27.6; tritanopia changes it least, 21.2.

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

    #837200 ΔE2000 23.7

    Distinct

    Reads as soft amber

  • Deuteranopia

    No working green (medium-wavelength) cones

    #776A18 ΔE2000 22.3

    Distinct

    Reads as muted brown

  • Tritanopia

    No working blue (short-wavelength) cones

    #007C6C ΔE2000 21.2

    Distinct

    Reads as muted teal

  • Achromatopsia

    No cone color vision; lightness only

    #6D6D6D ΔE2000 27.6

    Distinct

    Reads as gray

Pairing check

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

VisionThe pairΔE2000Verdict
Normal vision#008000 · #963BA382.0Stays distinct
Protanopia#837200 · #245BA653.7Stays distinct
Deuteranopia#776A18 · #4966A046.8Stays distinct
Tritanopia#007C6C · #984B6A48.8Stays distinct
Achromatopsia#6D6D6D · #6262624.2Easily confused

Harmony

Color harmonies for #008000

Its complement is #963BA3, a vivid magenta.

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

Open the Harmony Studio
  • Base#008000
  • Complement#963BA3

Complementary

Open in Harmony Studio
  • −30°#6A6F00
  • Base#008000
  • +30°#007B63
  • Base#008000
  • +120°#2C61CD
  • +240°#B92C36
  • Base#008000
  • +150°#6F4DC3
  • +210°#AF2D72

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-green: #008000;
}

Tailwind config

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

Tailwind v4 theme

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

@theme {
  --color-green: oklch(0.520 0.177 142.5);
}

Design token (W3C DTCG)

{
  "color": {
    "green": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0, 0.502, 0],
        "hex": "#008000"
      },
      "$description": "CSS named color green"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let green = Color(.sRGB, red: 0.000, green: 0.502, blue: 0.000, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Green = Color(0xFF008000)
}

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 #008000 in the tools

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