Glitch

A linear gradient sweeping from mid teal to mid orange, interpolated in OKLCH across 3 stops so the midpoint stays vivid instead of greying out.

Type
Linear
Stops
3
Space
OKLCH
Direction
90deg

The stops behind Glitch

Endpoints sit closest to mediumseagreen and red.

0% · #00b087 L 0.6 · C 0.3 · H 180
50% · #a226ff L 0.6 · C 0.3 · H 300
100% · #f31400 L 0.6 · C 0.3 · H 60

Create Glitch 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(
    90,
    'oklch(0.60 0.30 180)',
    'oklch(0.60 0.30 300)',
    'oklch(0.60 0.30 60)',
);
use PhpColor\Color\Gradient\Gradient; $gradient = Gradient::linear( 90, 'oklch(0.60 0.30 180)', 'oklch(0.60 0.30 300)', 'oklch(0.60 0.30 60)', );

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 Glitch 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(90deg, oklch(0.60 0.30 180), oklch(0.60 0.30 300), oklch(0.60 0.30 60));
background: linear-gradient(90deg, oklch(0.60 0.30 180), oklch(0.60 0.30 300), oklch(0.60 0.30 60));