Royal Blue

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

Hex
#4169e1
sRGB
rgb(65 105 225)
OKLCH
oklch(0.5598 0.1882 266.4)

Royal Blue is a curated PHPColor catalog color with the canonical value #4169e1.

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

$royalBlue = Color::parse('#4169E1');
use PhpColor\Color\Color; $royalBlue = Color::parse('#4169E1');

ColorInterface

$royalBlue

#4169e1 · oklch(0.5598 0.1882 266.4)

Build a Royal Blue harmony

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

<?php

$harmony = $royalBlue->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $royalBlue->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#4169e1
  2. 1#c33377
  3. 2#a46700
  4. 3#009571
Royal Blue and its three generated partners

Generate a Royal Blue scale

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

<?php

$oklch = $royalBlue->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 = $royalBlue->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 Royal Blue for the web

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

<?php

$hex   = $royalBlue->toHex();
$rgb   = $royalBlue->toCss('srgb');
$oklch = $royalBlue->to('oklch')->toCss();
$hex = $royalBlue->toHex(); $rgb = $royalBlue->toCss('srgb'); $oklch = $royalBlue->to('oklch')->toCss();
hex
#4169e1
rgb
rgb(65 105 225)
oklch
oklch(0.559848 0.188234 266.4)

Keep exploring

Continue from Royal Blue