Candy Floss

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

Type
Linear
Stops
2
Space
OKLCH
Direction
45deg

The stops behind Candy Floss

Endpoints sit closest to thistle and thistle.

0% · #ffdcff L 0.95 · C 0.08 · H 330
100% · #eaccff L 0.9 · C 0.12 · H 300

Create Candy Floss 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(
    45,
    'oklch(0.95 0.08 330)',
    'oklch(0.90 0.12 300)',
);
use PhpColor\Color\Gradient\Gradient; $gradient = Gradient::linear( 45, 'oklch(0.95 0.08 330)', 'oklch(0.90 0.12 300)', );

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 Candy Floss 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(45deg, oklch(0.95 0.08 330), oklch(0.90 0.12 300));
background: linear-gradient(45deg, oklch(0.95 0.08 330), oklch(0.90 0.12 300));

Keep exploring

Build on Candy Floss