Red

A mid, warm orange with the energy of a warm sky.

Hex
#ff0000
sRGB
rgb(255 0 0)
OKLCH
oklch(0.6280 0.2577 29.2)

Red is a standard CSS named color with the canonical value #ff0000.

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

$red = Color::parse('#FF0000');
use PhpColor\Color\Color; $red = Color::parse('#FF0000');

ColorInterface

$red

#ff0000 · oklch(0.6280 0.2577 29.2)

Build a Red harmony

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

<?php

$harmony = $red->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $red->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#ff0000
  2. 1#7b9900
  3. 2#00a9db
  4. 3#a34fff
Red and its three generated partners

Generate a Red scale

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

<?php

$oklch = $red->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 = $red->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 the complete Red scale →

Format Red for the web

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

<?php

$hex   = $red->toHex();
$rgb   = $red->toCss('srgb');
$oklch = $red->to('oklch')->toCss();
$hex = $red->toHex(); $rgb = $red->toCss('srgb'); $oklch = $red->to('oklch')->toCss();
hex
#ff0000
rgb
rgb(255 0 0)
oklch
oklch(0.627955 0.257683 29.2339)

Keep exploring

Continue from Red