Brown
A deep, warm orange with the energy of a warm sky.
Create Brown 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;
$brown = Color::parse('#A52A2A');
use PhpColor\Color\Color;
$brown = Color::parse('#A52A2A');
ColorInterface
$brown
#a52a2a · oklch(0.4806 0.1597 25.6)
Build a Brown harmony
tetradic() keeps Brown and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $brown->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $brown->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#a52a2a - 1
#5c6600 - 2
#007389 - 3
#6744ac
Generate a Brown scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $brown->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 = $brown->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 Brown for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $brown->toHex();
$rgb = $brown->toCss('srgb');
$oklch = $brown->to('oklch')->toCss();
$hex = $brown->toHex();
$rgb = $brown->toCss('srgb');
$oklch = $brown->to('oklch')->toCss();
- hex
#a52a2a- rgb
rgb(165 42 42)- oklch
oklch(0.480613 0.159657 25.5621)