0% · #00c8d1
L 0.75 · C 0.14 · H 200
Cool Spectrum
A linear gradient sweeping from light cyan to mid red, interpolated in OKLCH across 4 stops so the midpoint stays vivid instead of greying out.
- Type
- Linear
- Stops
- 4
- Space
- OKLCH
- Direction
- 90deg
The stops behind Cool Spectrum
Endpoints sit closest to darkturquoise and deeppink.
33% · #0070ff
L 0.6 · C 0.26 · H 260
67% · #9c43ff
L 0.6 · C 0.26 · H 300
100% · #fd00a6
L 0.65 · C 0.28 · H 350
Create Cool Spectrum 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.75 0.14 200)',
'oklch(0.60 0.26 260)',
'oklch(0.60 0.26 300)',
'oklch(0.65 0.28 350)',
);
use PhpColor\Color\Gradient\Gradient;
$gradient = Gradient::linear(
90,
'oklch(0.75 0.14 200)',
'oklch(0.60 0.26 260)',
'oklch(0.60 0.26 300)',
'oklch(0.65 0.28 350)',
);
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 Cool Spectrum 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.75 0.14 200), oklch(0.60 0.26 260), oklch(0.60 0.26 300), oklch(0.65 0.28 350));
background: linear-gradient(90deg, oklch(0.75 0.14 200), oklch(0.60 0.26 260), oklch(0.60 0.26 300), oklch(0.65 0.28 350));