Indigo
A mid, cool indigo -- the dependable foundation of trustworthy interfaces.
Create Indigo 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;
$indigo = Color::parse('#6366F1');
use PhpColor\Color\Color;
$indigo = Color::parse('#6366F1');
ColorInterface
$indigo
#6366f1 · oklch(0.5854 0.2041 277.1)
Build an Indigo harmony
tetradic() keeps Indigo and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $indigo->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $indigo->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#6366f1 - 1
#d72f67 - 2
#9f7700 - 3
#009e90
Generate an Indigo scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $indigo->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 = $indigo->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 Indigo for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $indigo->toHex();
$rgb = $indigo->toCss('srgb');
$oklch = $indigo->to('oklch')->toCss();
$hex = $indigo->toHex();
$rgb = $indigo->toCss('srgb');
$oklch = $indigo->to('oklch')->toCss();
- hex
#6366f1- rgb
rgb(99 102 241)- oklch
oklch(0.585404 0.204055 277.117)