CSS named color

Olive #808000

The CSS keyword olive is #808000. It is a soft yellow in the brown family. In OKLCH it sits at lightness 0.581, chroma 0.127 and hue 109.8°.

Relative luminance
0.2003
OKLCH L · C · h
0.581 · 0.127 · 109.8
Best text
Black 5.00:1
Hue family
Brown

#808000 color codes

HEX
#808000
RGB
rgb(128, 128, 0)
HSL
hsl(60, 100%, 25%)
OKLCH
oklch(0.581 0.127 109.8)
OKLab
oklab(0.581 -0.043 0.119)
CIELAB (D65)
L* 51.87, a* -12.93, b* 56.67
XYZ (D65)
X 16.62, Y 20.03, Z 2.99
CMYK (naive)
cmyk(0%, 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 #808000 accessible?

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

    5.00:1

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

    4.19:1

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

    5.00:1

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

    4.19:1

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

Nearest versions that pass 4.5:1

  • For text on white

    #7A7A00 4.55:1

    Darkening its OKLCH lightness from 0.58 to 0.56 reaches 4.55:1 on white, keeping the hue.

  • For text on black

    #808000 5.00:1

    It already reaches 5.00:1 on black, so no change is needed.

Checking another pair? Use the Contrast Checker.

Studio

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

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

  1. 50#F9FCAC
    White
    1.07
    Black
    19.54
  2. 100#EFF29F
    White
    1.17
    Black
    17.87
  3. 200#DCDE86
    White
    1.41
    Black
    14.83
  4. 300#C3C465
    White
    1.84
    Black
    11.40
  5. 400#A7A842
    White
    2.52
    Black
    8.32
  6. 500This color#808000
    White
    4.19
    Black
    5.00
  7. 600#747400
    White
    4.95
    Black
    4.24
  8. 700#5C5C00
    White
    7.03
    Black
    2.98
  9. 800#434300
    White
    10.28
    Black
    2.04
  10. 900#2B2B00
    White
    14.50
    Black
    1.44
  11. 950#171700
    White
    18.11
    Black
    1.15

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

Gamut

How vivid #808000 can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.127; #808000 uses 100% of it. Display P3, which many recent phones and laptops show, reaches 0.147 there: 16% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.127
sRGB edge
0.127
Display P3 edge
0.147
Rec. 2020 edge
0.151
Dominant wavelength
570 nm
Excitation purity
79%
Chromaticity
x 0.4193, y 0.5052
  • This color#808000
  • Most vivid in sRGB#808000
  • Most vivid in Display P3oklch(0.581 0.147 109.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: #808000;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0.5064 0.5034 0); }
}

Mixing

Mixing #808000

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%#C0C080
  • OKLab50%#BDBF90
  • OKLCH50%#BDBF90

Black #000000

  • sRGB50%#404000
  • OKLab50%#2E2E00
  • OKLCH50%#2E2E00

Its complement #7A6CC0

  • sRGB50%#7D7660
  • OKLab50%#7A7B7A
  • OKLCH50%#008C91
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #808000, white);
color: color-mix(in oklch, #808000 50%, white);

In use

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

For text on this page, the nearest shade that passes is #7A7A00 4.55:1

Dark page

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

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

Color vision

How #808000 looks with color blindness

Achromatopsia changes it most, ΔE2000 25.2; deuteranopia changes it least, 4.9.

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

    #8B7A00 ΔE2000 5.3

    Noticeable

    Reads as soft amber

  • Deuteranopia

    No working green (medium-wavelength) cones

    #8D7D13 ΔE2000 4.9

    Close match

    Reads as soft amber

  • Tritanopia

    No working blue (short-wavelength) cones

    #8A776C ΔE2000 23.9

    Distinct

    Reads as grayish orange

  • Achromatopsia

    No cone color vision; lightness only

    #7C7C7C ΔE2000 25.2

    Distinct

    Reads as gray

Pairing check

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

VisionThe pairΔE2000Verdict
Normal vision#808000 · #7A6CC060.7Stays distinct
Protanopia#8B7A00 · #5079C352.8Stays distinct
Deuteranopia#8D7D13 · #5076BE51.9Stays distinct
Tritanopia#8A776C · #687C8D19.7Stays distinct
Achromatopsia#7C7C7C · #7878781.6Easily confused

Harmony

Color harmonies for #808000

Its complement is #7A6CC0, a soft violet, 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#808000
  • Complement#7A6CC0

Complementary

Open in Harmony Studio
  • −30°#A07100
  • Base#808000
  • +30°#4F8C40
  • Base#808000
  • +120°#0086B1
  • +240°#B05885
  • Base#808000
  • +150°#4C7AC5
  • +210°#9B60A9

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-olive: #808000;
}

Tailwind config

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

Tailwind v4 theme

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

@theme {
  --color-olive: oklch(0.581 0.127 109.8);
}

Design token (W3C DTCG)

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

SwiftUI color

import SwiftUI

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

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Olive = Color(0xFF808000)
}

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

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