Skip to content
Let’s chat ↗

THE COLOR LIBRARY / Cool

Green color codes.

The CSS green color code is #008000. Its RGB value is rgb(0, 128, 0) and its HSL value is hsl(120, 100%, 25.1%). Start with the exact reference, then choose a shade for the job.

A color name describes a family in everyday language. This page uses the standardized CSS keyword as its reference; your brand’s green may be different.

Explore the shades ↓
CSS / greenGreen#008000

COPY. PASTE. MAKE IT YOURS.

Green in HEX, RGB, and HSL

HEX#008000
RGBrgb(0, 128, 0)
HSLhsl(120, 100%, 25.1%)

HEX and RGB encode the same sRGB reference. HSL is calculated from it and rounded to two decimals for display. These are screen color values, not a CMYK print specification.

ONE COLOR. DIFFERENT ROLES.

Explore green tints and shades

Select a swatch to see its codes and compare text contrast.

UI COLOR SPECIMEN

Make the next step clear.

A label, a surface, and room to breathe.

Selected: Reference

Selected color

Reference · #008000

rgb(0, 128, 0)hsl(120, 100%, 25.1%)

The specimen picks whichever of black or white has higher contrast. It demonstrates a pair, not a complete accessible component.

Illustrative scale: tints mix the reference with white, shades with black, by the stated percentage in encoded sRGB channels. This is not a perceptually uniform scale. Black tints and white shades remain useful; mixing black with black or white with white repeats the reference.

Text contrast on green

The table follows your selected swatch, currently #008000. Decisions use the full calculated ratio; displayed ratios are rounded.

Text against the selected green surface
Text colorRatioAA ordinary textAA large text
Black #0000004.09:1Fail · 4.5:1Pass · 3:1
White #FFFFFF5.14:1Pass · 4.5:1Pass · 3:1

Large text is at least 18pt, or 14pt bold. These numeric checks apply to opaque, solid color pairs. Other criteria, states, backgrounds, and exceptions need review. Read W3C’s contrast guidance.

CSS green is #008000; the brighter #00FF00 is CSS lime. These values have substantially different contrast behavior.

Check a custom color pair ↗

IN A REAL INTERFACE

How to use green in product design

Give it one clear role

Green can indicate a completed operation when the interface also states the result. Treat completion as a product state with a label and next step, not just a color treatment.

A UI example to try

An import summary can display “Imported 24 rows” in a success panel. Include skipped-row details and a review link so the color does not hide a partial failure.

Work through a real screen

Use a completed-state row as the specimen: state the outcome in words and provide the next action if one exists. Do not make every successful response a large green panel; the amount of emphasis should fit the task. Review green alongside error and pending states so the full set remains understandable.

Compare nearby colors by purpose

Teal can be a distinct brand accent while lime can be a brighter highlight. If green already means success in the product, document when those neighboring hues are decorative and when they carry state. Avoid teaching conflicting meanings through adjacent screens.

  1. Choose the role. Decide whether green is a surface, foreground, accent, or status. Name the semantic token after that purpose.
  2. Test the actual pair. Compare its foreground and background at the intended size. Test hover, selected, focus, and supported themes independently.
  3. Document the decision. Keep the approved code, usage rule, and contrasting companion together. Preserve labels and non-color cues when communicating a state.

Copy a green CSS palette

These numeric names are illustrative palette tokens, not a standard scale. Connect approved values to semantic tokens such as --surface-highlight or --text-primary after testing their pairs.

:root {
  --green-100: #CCE6CC;
  --green-300: #66B366;
  --green-500: #008000;
  --green-700: #006000;
  --green-900: #004000;
}
Download CSS palette ↓

Turn palette values into semantic tokens ↗

Common questions about green

What is the HEX code for green?

The CSS named color green is #008000. Use that exact value when you want the standardized reference; use your own documented token when you mean a particular brand shade.

Is green accessible?

A color by itself cannot pass or fail accessibility. The foreground/background pair, content size, interaction state, and meaning all matter. Use the table above for the selected solid-color pair, then review the complete interface.

Explore related colors