Forest

A mid green with the freshness of a spring green.

Hex
#228b22
sRGB
rgb(34 139 34)
OKLCH
oklch(0.5578 0.1688 142.9)

Forest is a curated PHPColor catalog color with the canonical value #228b22.

Create Forest in PHP

Parse the catalog’s canonical value once, then keep the resulting color object throughout the rest of your code.

<?php

use PhpColor\Color\Color;

$forest = Color::parse('#228B22');
use PhpColor\Color\Color; $forest = Color::parse('#228B22');

ColorInterface

$forest

#228b22 · oklch(0.5578 0.1688 142.9)

Build a Forest harmony

tetradic() keeps Forest and adds three partners at equal quarter-turns around the OKLCH hue wheel.

<?php

$harmony = $forest->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $forest->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#228b22
  2. 1#0080c5
  3. 2#a14aac
  4. 3#bc4e00
Forest and its three generated partners

Generate a Forest scale

Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.

<?php

$oklch = $forest->to('oklch');

foreach ([0.97, 0.92, 0.84, 0.74, 0.66, 0.58, 0.48, 0.40, 0.32, 0.24, 0.16] as $lightness) {
    $step = $oklch->withChannel('l', $lightness);
}
$oklch = $forest->to('oklch'); foreach ([0.97, 0.92, 0.84, 0.74, 0.66, 0.58, 0.48, 0.40, 0.32, 0.24, 0.16] as $lightness) { $step = $oklch->withChannel('l', $lightness); }
50
100
200
300
400
500
600
700
800
900
950
Explore named color scales →

Format Forest for the web

The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.

<?php

$hex   = $forest->toHex();
$rgb   = $forest->toCss('srgb');
$oklch = $forest->to('oklch')->toCss();
$hex = $forest->toHex(); $rgb = $forest->toCss('srgb'); $oklch = $forest->to('oklch')->toCss();
hex
#228b22
rgb
rgb(34 139 34)
oklch
oklch(0.557805 0.168781 142.893)

Keep exploring

Continue from Forest