Sky
A light, cool blue -- the dependable foundation of trustworthy interfaces.
Create Sky 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;
$sky = Color::parse('#38BDF8');
use PhpColor\Color\Color;
$sky = Color::parse('#38BDF8');
ColorInterface
$sky
#38bdf8 · oklch(0.7535 0.1390 232.7)
Build a Sky harmony
tetradic() keeps Sky and adds three partners at equal quarter-turns around the OKLCH hue wheel.
<?php
$harmony = $sky->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
$harmony = $sky->tetradic();
foreach ($harmony as $color) {
echo $color->toHex().PHP_EOL;
}
- 0
#38bdf8 - 1
#d990e2 - 2
#f39455 - 3
#78c572
Generate a Sky scale
Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.
<?php
$oklch = $sky->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 = $sky->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 Sky for the web
The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.
<?php
$hex = $sky->toHex();
$rgb = $sky->toCss('srgb');
$oklch = $sky->to('oklch')->toCss();
$hex = $sky->toHex();
$rgb = $sky->toCss('srgb');
$oklch = $sky->to('oklch')->toCss();
- hex
#38bdf8- rgb
rgb(56 189 248)- oklch
oklch(0.753513 0.138989 232.661)