Malachite
A light green with the freshness of a spring green.
Create Malachite 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;
$malachite = Color::parse('#0BDA51');
use PhpColor\Color\Color;
$malachite = Color::parse('#0BDA51');
ColorInterface
$malachite
#0bda51 · oklch(0.7744 0.2293 146.9)
Build a Malachite harmony
tetradic() keeps Malachite and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $malachite->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $malachite->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#0bda51 - 1
#00c4ff - 2
#fe76ff - 3
#ff8300
Generate a Malachite scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $malachite->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 = $malachite->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 Malachite for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $malachite->toHex();
$rgb = $malachite->toCss('srgb');
$oklch = $malachite->to('oklch')->toCss();
$hex = $malachite->toHex();
$rgb = $malachite->toCss('srgb');
$oklch = $malachite->to('oklch')->toCss();
- hex
#0bda51- rgb
rgb(11 218 81)- oklch
oklch(0.774386 0.229278 146.855)