Navy

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

Hex
#000080
sRGB
rgb(0 0 128)
OKLCH
oklch(0.2711 0.1879 264.1)

Navy is a standard CSS named color with the canonical value #000080.

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

$navy = Color::parse('#000080');
use PhpColor\Color\Color; $navy = Color::parse('#000080');

ColorInterface

$navy

#000080 · oklch(0.2711 0.1879 264.1)

Build a Navy harmony

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

<?php

$harmony = $navy->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $navy->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#000080
  2. 1#5f002d
  3. 2#4e0a00
  4. 3#003d1f
Navy and its three generated partners

Generate a Navy scale

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

<?php

$oklch = $navy->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 = $navy->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 Navy for the web

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

<?php

$hex   = $navy->toHex();
$rgb   = $navy->toCss('srgb');
$oklch = $navy->to('oklch')->toCss();
$hex = $navy->toHex(); $rgb = $navy->toCss('srgb'); $oklch = $navy->to('oklch')->toCss();
hex
#000080
rgb
rgb(0 0 128)
oklch
oklch(0.27115 0.187888 264.052)

Keep exploring

Continue from Navy