Prussian Blue

A dark, cool blue -- the dependable foundation of trustworthy interfaces.

Hex
#003153
sRGB
rgb(0 49 83)
OKLCH
oklch(0.3035 0.0779 245.9)

Prussian Blue is a curated PHPColor catalog color with the canonical value #003153.

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; }
  1. 0#003153
  2. 1#461d3d
  3. 2#482500
  4. 3#003a1d
Prussian Blue and its three generated partners

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
Explore named color scales →

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)

Keep exploring

Continue from Prussian Blue