MidnightBlue

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

Hex
#191970
sRGB
rgb(25 25 112)
OKLCH
oklch(0.2881 0.1436 272.8)

MidnightBlue is a standard CSS named color with the canonical value #191970.

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

$midnightblue = Color::parse('#191970');
use PhpColor\Color\Color; $midnightblue = Color::parse('#191970');

ColorInterface

$midnightblue

#191970 · oklch(0.2881 0.1436 272.8)

Build a MidnightBlue harmony

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

<?php

$harmony = $midnightblue->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $midnightblue->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#191970
  2. 1#5c0024
  3. 2#432300
  4. 3#003e31
MidnightBlue and its three generated partners

Generate a MidnightBlue scale

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

<?php

$oklch = $midnightblue->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 = $midnightblue->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 MidnightBlue for the web

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

<?php

$hex   = $midnightblue->toHex();
$rgb   = $midnightblue->toCss('srgb');
$oklch = $midnightblue->to('oklch')->toCss();
$hex = $midnightblue->toHex(); $rgb = $midnightblue->toCss('srgb'); $oklch = $midnightblue->to('oklch')->toCss();
hex
#191970
rgb
rgb(25 25 112)
oklch
oklch(0.288119 0.143626 272.765)

Keep exploring

Continue from MidnightBlue