Lavender

A light, warm violet with the energy of a warm sky.

Hex
#a78bfa
sRGB
rgb(167 139 250)
OKLCH
oklch(0.7090 0.1592 293.5)

This curated Lavender is #a78bfa. The CSS named color lavender is the distinct color #e6e6fa.

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

$lavender = Color::parse('#A78BFA');
use PhpColor\Color\Color; $lavender = Color::parse('#A78BFA');

ColorInterface

$lavender

#a78bfa · oklch(0.7090 0.1592 293.5)

Build a Lavender harmony

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

<?php

$harmony = $lavender->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $lavender->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#a78bfa
  2. 1#f47470
  3. 2#a2ab00
  4. 3#00bcce
Lavender and its three generated partners

Generate a Lavender scale

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

<?php

$oklch = $lavender->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 = $lavender->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 Lavender for the web

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

<?php

$hex   = $lavender->toHex();
$rgb   = $lavender->toCss('srgb');
$oklch = $lavender->to('oklch')->toCss();
$hex = $lavender->toHex(); $rgb = $lavender->toCss('srgb'); $oklch = $lavender->to('oklch')->toCss();
hex
#a78bfa
rgb
rgb(167 139 250)
oklch
oklch(0.708969 0.159168 293.541)

Keep exploring

Continue from Lavender