Violet

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

Hex
#ee82ee
sRGB
rgb(238 130 238)
OKLCH
oklch(0.7619 0.1861 327.2)

Violet is a standard CSS named color with the canonical value #ee82ee.

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

$violet = Color::parse('#EE82EE');
use PhpColor\Color\Color; $violet = Color::parse('#EE82EE');

ColorInterface

$violet

#ee82ee · oklch(0.7619 0.1861 327.2)

Build a Violet harmony

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

<?php

$harmony = $violet->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $violet->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#ee82ee
  2. 1#ff8d00
  3. 2#4cd067
  4. 3#00bfff
Violet and its three generated partners

Generate a Violet scale

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

<?php

$oklch = $violet->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 = $violet->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 Violet scale →

Format Violet for the web

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

<?php

$hex   = $violet->toHex();
$rgb   = $violet->toCss('srgb');
$oklch = $violet->to('oklch')->toCss();
$hex = $violet->toHex(); $rgb = $violet->toCss('srgb'); $oklch = $violet->to('oklch')->toCss();
hex
#ee82ee
rgb
rgb(238 130 238)
oklch
oklch(0.761899 0.186122 327.21)