Basic HTML and CSS color
Green #008000
Green (CSS keyword green) has the hex code #008000 and the RGB value rgb(0, 128, 0): a medium-dark, vivid green.
CSS green (#008000) is half-intensity green from the HTML palette. The pure #00ff00 primary is called lime in CSS, a difference from X11, where green meant #00ff00.
Color codes for Green
| CSS keyword | green |
|---|---|
| HEX | #008000 |
| RGB | rgb(0, 128, 0) |
| HSL | hsl(120, 100%, 25%) |
| HWB | hwb(120 0% 50%) |
| OKLCH | oklch(52% 0.177 142.5) |
| CMYK (naive, no ICC profile) | cmyk(100%, 0%, 100%, 50%) |
| Decimal | 32,768 |
| Hue family | Greens |
Contrast and accessibility
On green, white text has a contrast ratio of 5.13:1 and passes AA for normal text; black text reaches 4.08: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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on green | 4.08:1 | Fail | Pass | Fail | Fail | 29.5 |
| White text on green | 5.13:1 | Pass | Pass | Fail | Pass | −80.0 |
| Green text on white | 5.13:1 | Pass | Pass | Fail | Pass | 74.6 |
| Green text on black | 4.08:1 | Fail | Pass | Fail | Fail | −27.1 |
Tints and shades
Each step mixes green with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, green, white 25%) in CSS.
Tints (mixed with white)
- 5%
#0d860d - 15%
#269326 - 25%
#40a040 - 35%
#59ac59 - 45%
#73b973 - 55%
#8cc68c - 65%
#a6d3a6 - 75%
#bfdfbf - 85%
#d9ecd9 - 95%
#f2f9f2
Shades (mixed with black)
- 5%
#007a00 - 15%
#006d00 - 25%
#006000 - 35%
#005300 - 45%
#004600 - 55%
#003a00 - 65%
#002d00 - 75%
#002000 - 85%
#001300 - 95%
#000600
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, green's complementary color is #963BA3 (close to darkorchid), its analogous colors are #6B6F00 and #007E61, and its triadic partners are #2C61CD and #B92C36. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #963ba3 |
| Analogous | −30°, +30° | #6b6f00#007e61 |
| Triadic | +120°, +240° | #2c61cd#b92c36 |
| Split-complementary | +150°, +210° | #6f4dc3#af2d72 |
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?
Green is a cool color: its hue is 120° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
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
| Color | HEX | ΔE OK |
|---|---|---|
| forestgreen | #228b22 | 3.9 |
| seagreen | #2e8b57 | 8.2 |
| darkgreen | #006400 | 8.8 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| green-700 | #008236 | 3.2 |
| lime-700 | #497d00 | 3.9 |
| emerald-700 | #007a55 | 8.3 |
Code snippets
.element {
color: green;
background-color: #008000;
border-color: rgb(0 128 0);
outline-color: oklch(52% 0.177 142.5);
}<div class="bg-[#008000] text-white">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-green: #008000;
}
/* then use bg-green, text-green, border-green */import SwiftUI
extension Color {
static let green = Color(red: 0.000, green: 0.502, blue: 0.000)
}import androidx.compose.ui.graphics.Color
val Green = Color(0xFF008000)import 'package:flutter/material.dart';
const green = Color(0xFF008000);<!-- res/values/colors.xml -->
<color name="green">#008000</color>Frequently asked questions
- What is the hex code for green?
- The hex code for green is #008000. The same color is rgb(0, 128, 0), hsl(120, 100%, 25%) and oklch(52% 0.177 142.5), and in CSS you can also write the keyword green directly.
- Is green a warm or cool color?
- Green is a cool color: its hue is 120° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
- What colors go with green?
- Rotating the hue in OKLCH while keeping lightness and chroma, green's complementary color is #963BA3 (close to darkorchid), its analogous colors are #6B6F00 and #007E61, and its triadic partners are #2C61CD and #B92C36. For text on top, white gives the higher contrast.
- Can you use white text on green?
- White text on green has a contrast ratio of 5.13:1, which passes AA for normal text but not AAA under WCAG 2.2. Black text reaches 4.08:1 and passes AA only for large text (24 px, or 18.66 px bold, and up). In APCA terms that is Lc −80.0 for white and Lc 29.5 for black.
- What is the RGB value of green?
- Green is rgb(0, 128, 0): red 0, green 128 and blue 0 on the 0 to 255 scale, or 0.0%, 50.2% and 0.0%. As a decimal integer it is 32768.
Last reviewed by Arielton Oberek.