Topaz
A pastel, warm yellow with the energy of a warm sky.
Create Topaz 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;
$topaz = Color::parse('#FFC87C');
use PhpColor\Color\Color;
$topaz = Color::parse('#FFC87C');
ColorInterface
$topaz
#ffc87c · oklch(0.8659 0.1127 74.3)
Build a Topaz harmony
tetradic() keeps Topaz and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $topaz->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $topaz->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#ffc87c - 1
#87ebc0 - 2
#9fd7ff - 3
#ffb5e5
Generate a Topaz scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $topaz->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 = $topaz->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 Topaz for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $topaz->toHex();
$rgb = $topaz->toCss('srgb');
$oklch = $topaz->to('oklch')->toCss();
$hex = $topaz->toHex();
$rgb = $topaz->toCss('srgb');
$oklch = $topaz->to('oklch')->toCss();
- hex
#ffc87c- rgb
rgb(255 200 124)- oklch
oklch(0.865907 0.112699 74.3387)