0% · #47d2e8
L 0.8 · C 0.12 · H 210
Ocean Depths
A linear gradient sweeping from light cyan to dark indigo, interpolated in OKLCH across 3 stops so the midpoint stays vivid instead of greying out.
- Type
- Linear
- Stops
- 3
- Space
- OKLCH
- Direction
- 180deg
The stops behind Ocean Depths
Endpoints sit closest to darkturquoise and midnightblue.
50% · #0060a4
L 0.45 · C 0.18 · H 230
100% · #000323
L 0.12 · C 0.08 · H 250
Create Ocean Depths 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(
180,
'oklch(0.80 0.12 210)',
'oklch(0.45 0.18 230)',
'oklch(0.12 0.08 250)',
);
use PhpColor\Color\Gradient\Gradient;
$gradient = Gradient::linear(
180,
'oklch(0.80 0.12 210)',
'oklch(0.45 0.18 230)',
'oklch(0.12 0.08 250)',
);
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 Ocean Depths 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(180deg, oklch(0.80 0.12 210), oklch(0.45 0.18 230), oklch(0.12 0.08 250));
background: linear-gradient(180deg, oklch(0.80 0.12 210), oklch(0.45 0.18 230), oklch(0.12 0.08 250));