Ultramarine

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

Hex
#120a8f
sRGB
rgb(18 10 143)
OKLCH
oklch(0.3073 0.1944 268.5)

Ultramarine is a curated PHPColor catalog color with the canonical value #120a8f.

Create Ultramarine 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;

$ultramarine = Color::parse('#120A8F');
use PhpColor\Color\Color; $ultramarine = Color::parse('#120A8F');

ColorInterface

$ultramarine

#120a8f · oklch(0.3073 0.1944 268.5)

Build an Ultramarine harmony

tetradic() keeps Ultramarine and adds three partners at equal quarter-turns around the OKLCH hue wheel.

<?php

$harmony = $ultramarine->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $ultramarine->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#120a8f
  2. 1#6e002e
  3. 2#561c00
  4. 3#004830
Ultramarine and its three generated partners

Generate an Ultramarine scale

Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.

<?php

$oklch = $ultramarine->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 = $ultramarine->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 Ultramarine for the web

The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.

<?php

$hex   = $ultramarine->toHex();
$rgb   = $ultramarine->toCss('srgb');
$oklch = $ultramarine->to('oklch')->toCss();
$hex = $ultramarine->toHex(); $rgb = $ultramarine->toCss('srgb'); $oklch = $ultramarine->to('oklch')->toCss();
hex
#120a8f
rgb
rgb(18 10 143)
oklch
oklch(0.307299 0.194397 268.462)

Keep exploring

Continue from Ultramarine