Midnight Sun

A radial gradient sweeping from pastel yellow to dark indigo, interpolated in OKLCH across 3 stops so the midpoint stays vivid instead of greying out.

Type
Radial
Stops
3
Space
OKLCH
Direction
circle at bottom

The stops behind Midnight Sun

Endpoints sit closest to navajowhite and black.

0% · #fcd176 L 0.88 · C 0.12 · H 85
50% · #333463 L 0.35 · C 0.08 · H 280
100% · #000418 L 0.12 · C 0.05 · H 260

Create Midnight Sun in PHP

Build a radial gradient from the catalog stops, then let PHPColor assign their positions.

<?php

use PhpColor\Color\Gradient\Gradient;

$gradient = Gradient::radial(
    'oklch(0.88 0.12 85)',
    'oklch(0.35 0.08 280)',
    'oklch(0.12 0.05 260)',
);
use PhpColor\Color\Gradient\Gradient; $gradient = Gradient::radial( 'oklch(0.88 0.12 85)', 'oklch(0.35 0.08 280)', 'oklch(0.12 0.05 260)', );

Inspect and convert its stops

Each stop remains a color object, ready for conversion, contrast checks, or further manipulation.

<?php

foreach ($gradient->getStops() as $stop) {
    echo $stop->color->to('oklch')->toCss();
}
foreach ($gradient->getStops() as $stop) { echo $stop->color->to('oklch')->toCss(); }

Format Midnight Sun for CSS

Serialize the gradient directly, or choose a wide-gamut notation for every stop.

<?php

$css = $gradient->toCss();
$p3  = $gradient->toCss('display-p3');
$css = $gradient->toCss(); $p3 = $gradient->toCss('display-p3');
background: radial-gradient(circle at bottom, oklch(0.88 0.12 85), oklch(0.35 0.08 280), oklch(0.12 0.05 260));
background: radial-gradient(circle at bottom, oklch(0.88 0.12 85), oklch(0.35 0.08 280), oklch(0.12 0.05 260));

Keep exploring

Build on Midnight Sun