Skip to content

CSS named color

ForestGreen #228B22

ForestGreen (CSS keyword forestgreen) has the hex code #228B22 and the RGB value rgb(34, 139, 34): a medium-dark, vivid green.

ForestGreen#228B22

A medium, natural green evoking dense foliage. It is darker than limegreen and more saturated than seagreen, a frequent pick for "success" states.

Color codes for ForestGreen

Color codes for ForestGreen
CSS keywordforestgreen
HEX#228B22
RGBrgb(34, 139, 34)
HSLhsl(120, 61%, 34%)
HWBhwb(120 13% 45%)
OKLCHoklch(55.8% 0.169 142.9)
CMYK (naive, no ICC profile)cmyk(76%, 0%, 76%, 45%)
Decimal2,263,842
Hue familyGreens

Contrast and accessibility

On forestgreen, black text has a contrast ratio of 4.78:1 and passes AA for normal text; white text reaches 4.38: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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on forestgreen4.78:1PassPassFailPass34.2
White text on forestgreen4.38:1FailPassFailFail−75.4
Forestgreen text on white4.38:1FailPassFailFail69.9
Forestgreen text on black4.78:1PassPassFailPass−31.7

Tints and shades

Each step mixes forestgreen with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, forestgreen, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #2d912d
  2. 15%
    #439c43
  3. 25%
    #59a859
  4. 35%
    #6fb46f
  5. 45%
    #85bf85
  6. 55%
    #9ccb9c
  7. 65%
    #b2d6b2
  8. 75%
    #c8e2c8
  9. 85%
    #deeede
  10. 95%
    #f4f9f4

Shades (mixed with black)

  1. 5%
    #208420
  2. 15%
    #1d761d
  3. 25%
    #1a681a
  4. 35%
    #165a16
  5. 45%
    #134c13
  6. 55%
    #0f3f0f
  7. 65%
    #0c310c
  8. 75%
    #092309
  9. 85%
    #051505
  10. 95%
    #020702

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, forestgreen's complementary color is #A14AAC (close to darkorchid), its analogous colors are #767B00 and #008B6C, and its triadic partners are #3C6DD5 and #C33E42. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#a14aac
Analogous−30°, +30°#767b00#008b6c
Triadic+120°, +240°#3c6dd5#c33e42
Split-complementary+150°, +210°#7a5acc#b93f7c

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?

ForestGreen 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

Nearest CSS named colors
ColorHEXΔE OK
green#0080003.9
seagreen#2e8b575.9
olivedrab#6b8e236.8

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
green-700#0082364.0
lime-700#497d004.3
emerald-600#0099667.1

Code snippets

CSS
.element {
  color: forestgreen;
  background-color: #228b22;
  border-color: rgb(34 139 34);
  outline-color: oklch(55.8% 0.169 142.9);
}
Tailwind CSS
<div class="bg-[#228b22] text-black">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-forestgreen: #228b22;
}
/* then use bg-forestgreen, text-forestgreen, border-forestgreen */
SwiftUI
import SwiftUI

extension Color {
  static let forestgreen = Color(red: 0.133, green: 0.545, blue: 0.133)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Forestgreen = Color(0xFF228B22)
Flutter
import 'package:flutter/material.dart';

const forestgreen = Color(0xFF228B22);
Android XML
<!-- res/values/colors.xml -->
<color name="forestgreen">#228B22</color>

Frequently asked questions

What is the hex code for forestgreen?
The hex code for forestgreen is #228B22. The same color is rgb(34, 139, 34), hsl(120, 61%, 34%) and oklch(55.8% 0.169 142.9), and in CSS you can also write the keyword forestgreen directly.
Is forestgreen a warm or cool color?
ForestGreen 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 forestgreen?
Rotating the hue in OKLCH while keeping lightness and chroma, forestgreen's complementary color is #A14AAC (close to darkorchid), its analogous colors are #767B00 and #008B6C, and its triadic partners are #3C6DD5 and #C33E42. For text on top, black gives the higher contrast.
Can you use white text on forestgreen?
White text on forestgreen has a contrast ratio of 4.38:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 4.78:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −75.4 for white and Lc 34.2 for black.
What is the RGB value of forestgreen?
ForestGreen is rgb(34, 139, 34): red 34, green 139 and blue 34 on the 0 to 255 scale, or 13.3%, 54.5% and 13.3%. As a decimal integer it is 2263842.

Last reviewed by Arielton Oberek.