Sunset
A pastel yellow with the freshness of a spring yellow.
Create Sunset 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;
$sunset = Color::parse('#FAD6A5');
use PhpColor\Color\Color;
$sunset = Color::parse('#FAD6A5');
ColorInterface
$sunset
#fad6a5 · oklch(0.8949 0.0751 75.1)
Build a Sunset harmony
tetradic() keeps Sunset and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $sunset->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $sunset->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#fad6a5 - 1
#aeedd0 - 2
#bbdfff - 3
#ffc9e8
Generate a Sunset scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $sunset->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 = $sunset->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 Sunset for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $sunset->toHex();
$rgb = $sunset->toCss('srgb');
$oklch = $sunset->to('oklch')->toCss();
$hex = $sunset->toHex();
$rgb = $sunset->toCss('srgb');
$oklch = $sunset->to('oklch')->toCss();
- hex
#fad6a5- rgb
rgb(250 214 165)- oklch
oklch(0.894877 0.0750933 75.1165)