Olive
A mid green with the freshness of a spring green.
Create Olive 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;
$olive = Color::parse('#65A30D');
use PhpColor\Color\Color;
$olive = Color::parse('#65A30D');
ColorInterface
$olive
#65a30d · oklch(0.6482 0.1754 131.7)
Build an Olive harmony
tetradic() keeps Olive and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $olive->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $olive->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#65a30d - 1
#00a3da - 2
#b16adb - 3
#e36128
Generate an Olive scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $olive->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 = $olive->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
Format Olive for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $olive->toHex();
$rgb = $olive->toCss('srgb');
$oklch = $olive->to('oklch')->toCss();
$hex = $olive->toHex();
$rgb = $olive->toCss('srgb');
$oklch = $olive->to('oklch')->toCss();
- hex
#65a30d- rgb
rgb(101 163 13)- oklch
oklch(0.648167 0.175448 131.684)