Crimson
A mid, warm orange with the energy of a warm sky.
Create Crimson 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;
$crimson = Color::parse('#DC2626');
use PhpColor\Color\Color;
$crimson = Color::parse('#DC2626');
ColorInterface
$crimson
#dc2626 · oklch(0.5771 0.2152 27.3)
Build a Crimson harmony
tetradic() keeps Crimson and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $crimson->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $crimson->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#dc2626 - 1
#738600 - 2
#0096b9 - 3
#8b50e6
Generate a Crimson scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $crimson->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 = $crimson->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 Crimson for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $crimson->toHex();
$rgb = $crimson->toCss('srgb');
$oklch = $crimson->to('oklch')->toCss();
$hex = $crimson->toHex();
$rgb = $crimson->toCss('srgb');
$oklch = $crimson->to('oklch')->toCss();
- hex
#dc2626- rgb
rgb(220 38 38)- oklch
oklch(0.577099 0.215157 27.325)