Prussian Blue
A dark, cool blue -- the dependable foundation of trustworthy interfaces.
Create Prussian Blue 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;
$prussianBlue = Color::parse('#003153');
use PhpColor\Color\Color;
$prussianBlue = Color::parse('#003153');
ColorInterface
$prussianBlue
#003153 · oklch(0.3035 0.0779 245.9)
Build a Prussian Blue harmony
tetradic() keeps Prussian Blue and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $prussianBlue->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $prussianBlue->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#003153 - 1
#461d3d - 2
#482500 - 3
#003a1d
Generate a Prussian Blue scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $prussianBlue->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 = $prussianBlue->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 Prussian Blue for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $prussianBlue->toHex();
$rgb = $prussianBlue->toCss('srgb');
$oklch = $prussianBlue->to('oklch')->toCss();
$hex = $prussianBlue->toHex();
$rgb = $prussianBlue->toCss('srgb');
$oklch = $prussianBlue->to('oklch')->toCss();
- hex
#003153- rgb
rgb(0 49 83)- oklch
oklch(0.303503 0.0779113 245.921)