Live PHP Playground

Write PHPColor code, run it instantly, and inspect the result. PHP 8.4, ready to use with no installation.

$c = Color::parse('#3a86ff');
oklch(0.64 0.2 260)

Example

Hello Color

Parse any CSS color, get every representation.

Explore
Color::mix($a, $b, 0.5, 'oklab');

Example

Perceptual Mixing

Oklab vs sRGB. Why the middle of a gradient matters.

Explore
ColorPalette::tints($c, 5);

Example

Tints & Shades

Build design-token-ready scales from one base color.

Explore
$c->triadic();

Example

Harmonies

Color theory, one method call away.

Explore
Gradient::linear(90, $a, $b);

Example

Gradient Builder

Fluent API, Oklab by default, CSS out.

Explore
Color::contrast($fg, $bg);
5.57 AA

Example

Contrast Solver

Check WCAG, then fix failing colors automatically.

Explore
$sim->simulate($c);

Example

Vision Simulation

Check your palette for users with CVD.

Explore
$palette->toCssVariables();
--color-500: #3a86ff; --color-300: #9ec5ff;

Example

Design Tokens

Named palette out to CSS custom properties.

Explore