Periwinkle
A pastel, warm indigo with the energy of a warm sky.
Create Periwinkle 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;
$periwinkle = Color::parse('#CCCCFF');
use PhpColor\Color\Color;
$periwinkle = Color::parse('#CCCCFF');
ColorInterface
$periwinkle
#ccccff · oklch(0.8622 0.0705 284.8)
Build a Periwinkle harmony
tetradic() keeps Periwinkle and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $periwinkle->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $periwinkle->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#ccccff - 1
#fdbfc3 - 2
#d8d59f - 3
#9ae1e0
Generate a Periwinkle scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $periwinkle->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 = $periwinkle->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
Format Periwinkle for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $periwinkle->toHex();
$rgb = $periwinkle->toCss('srgb');
$oklch = $periwinkle->to('oklch')->toCss();
$hex = $periwinkle->toHex();
$rgb = $periwinkle->toCss('srgb');
$oklch = $periwinkle->to('oklch')->toCss();
- hex
#ccccff- rgb
rgb(204 204 255)- oklch
oklch(0.86218 0.0704582 284.827)