Khaki
A pastel lime with the freshness of a spring lime.
Create Khaki 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;
$khaki = Color::parse('#F0E68C');
use PhpColor\Color\Color;
$khaki = Color::parse('#F0E68C');
ColorInterface
$khaki
#f0e68c · oklch(0.9135 0.1119 102.8)
Build a Khaki harmony
tetradic() keeps Khaki and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $khaki->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $khaki->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#f0e68c - 1
#7efaf7 - 2
#d7d9ff - 3
#ffc4cd
Generate a Khaki scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $khaki->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 = $khaki->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 Khaki for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $khaki->toHex();
$rgb = $khaki->toCss('srgb');
$oklch = $khaki->to('oklch')->toCss();
$hex = $khaki->toHex();
$rgb = $khaki->toCss('srgb');
$oklch = $khaki->to('oklch')->toCss();
- hex
#f0e68c- rgb
rgb(240 230 140)- oklch
oklch(0.913489 0.111922 102.829)