Twilight

A linear gradient sweeping from deep violet to light cyan, interpolated in OKLCH across 2 stops so the midpoint stays vivid instead of greying out.

Type
Linear
Stops
2
Space
OKLCH
Direction
135deg

The stops behind Twilight

Endpoints sit closest to blueviolet and darkturquoise.

0% · #901bf7 L 0.55 · C 0.28 · H 300
100% · #00d3e4 L 0.75 · C 0.22 · H 200

Create Twilight in PHP

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

<?php

use PhpColor\Color\Gradient\Gradient;

$gradient = Gradient::linear(
    135,
    'oklch(0.55 0.28 300)',
    'oklch(0.75 0.22 200)',
);
use PhpColor\Color\Gradient\Gradient; $gradient = Gradient::linear( 135, 'oklch(0.55 0.28 300)', 'oklch(0.75 0.22 200)', );

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 Twilight 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: linear-gradient(135deg, oklch(0.55 0.28 300), oklch(0.75 0.22 200));
background: linear-gradient(135deg, oklch(0.55 0.28 300), oklch(0.75 0.22 200));