0% · #c7eaff
L 0.92 · C 0.05 · H 240
Serenity
A linear gradient sweeping from pastel blue to pastel orange, interpolated in OKLCH across 3 stops so the midpoint stays vivid instead of greying out.
- Type
- Linear
- Stops
- 3
- Space
- OKLCH
- Direction
- 135deg
The stops behind Serenity
Endpoints sit closest to lightblue and lavenderblush.
50% · #d5c2fb
L 0.85 · C 0.08 · H 300
100% · #ffedec
L 0.96 · C 0.02 · H 20
Create Serenity 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.92 0.05 240)',
'oklch(0.85 0.08 300)',
'oklch(0.96 0.02 20)',
);
use PhpColor\Color\Gradient\Gradient;
$gradient = Gradient::linear(
135,
'oklch(0.92 0.05 240)',
'oklch(0.85 0.08 300)',
'oklch(0.96 0.02 20)',
);
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 Serenity 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.92 0.05 240), oklch(0.85 0.08 300), oklch(0.96 0.02 20));
background: linear-gradient(135deg, oklch(0.92 0.05 240), oklch(0.85 0.08 300), oklch(0.96 0.02 20));