Yellow

A pastel lime with the freshness of a spring lime.

Hex
#ffff00
sRGB
rgb(255 255 0)
OKLCH
oklch(0.9680 0.2110 109.8)

Yellow is a standard CSS named color with the canonical value #ffff00.

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

$yellow = Color::parse('#FFFF00');
use PhpColor\Color\Color; $yellow = Color::parse('#FFFF00');

ColorInterface

$yellow

#ffff00 · oklch(0.9680 0.2110 109.8)

Build a Yellow harmony

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

<?php

$harmony = $yellow->tetradic();

foreach ($harmony as $color) {
    echo $color->toHex().PHP_EOL;
}
$harmony = $yellow->tetradic(); foreach ($harmony as $color) { echo $color->toHex().PHP_EOL; }
  1. 0#ffff00
  2. 1#00ffff
  3. 2#f4d8ff
  4. 3#ffb3b9
Yellow and its three generated partners

Generate a Yellow scale

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

<?php

$oklch = $yellow->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 = $yellow->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 Yellow scale →

Format Yellow for the web

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

<?php

$hex   = $yellow->toHex();
$rgb   = $yellow->toCss('srgb');
$oklch = $yellow->to('oklch')->toCss();
$hex = $yellow->toHex(); $rgb = $yellow->toCss('srgb'); $oklch = $yellow->to('oklch')->toCss();
hex
#ffff00
rgb
rgb(255 255 0)
oklch
oklch(0.967983 0.211006 109.769)