Cornsilk

A pastel lime with the freshness of a spring lime.

Hex
#fff8dc
sRGB
rgb(255 248 220)
OKLCH
oklch(0.9773 0.0373 95.4)

Cornsilk is a standard CSS named color with the canonical value #fff8dc.

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

$cornsilk = Color::parse('#FFF8DC');
use PhpColor\Color\Color; $cornsilk = Color::parse('#FFF8DC');

ColorInterface

$cornsilk

#fff8dc · oklch(0.9773 0.0373 95.4)

Build a Cornsilk harmony

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

<?php

$harmony = $cornsilk->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $cornsilk->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#fff8dc
  2. 1#ddfffb
  3. 2#f0f6ff
  4. 3#ffeef4
Cornsilk and its three generated partners

Generate a Cornsilk scale

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

<?php

$oklch = $cornsilk->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 = $cornsilk->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 Cornsilk for the web

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

<?php

$hex   = $cornsilk->toHex();
$rgb   = $cornsilk->toCss('srgb');
$oklch = $cornsilk->to('oklch')->toCss();
$hex = $cornsilk->toHex(); $rgb = $cornsilk->toCss('srgb'); $oklch = $cornsilk->to('oklch')->toCss();
hex
#fff8dc
rgb
rgb(255 248 220)
oklch
oklch(0.977301 0.0372576 95.4385)

Keep exploring

Continue from Cornsilk