RoyalBlue

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)

RoyalBlue is a standard CSS named color with the canonical value #4169e1.

Create RoyalBlue 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 RoyalBlue harmony

tetradic() keeps RoyalBlue 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
RoyalBlue and its three generated partners

Generate a RoyalBlue 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 RoyalBlue 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 RoyalBlue