Every in PHP

$srgb = $color->to('srgb');$lab = $color->to('lab');$p3 = $color->to('display-p3');$oklch = $color->to('oklch');$rec2020 = $color->to('rec2020');
Runtime
PHP 8.3+
Deps
Zero
Static analysis
PHPStan Max
Test Coverage
PHPUnit · 100%

Modern color engine

Modern color.
One PHP API.

Parse modern CSS, move between typed color spaces, inspect channels, transform perceptually, and serialize the result without rebuilding color math in every application.

sRGB Linear sRGB Display P3 A98 RGB ProPhoto Rec. 2020 XYZ Lab LCH OKLab OKLCH HSL HWB CMYK
Input and output

Hex · RGB · HSL · HWB · Lab · LCH · OKLab · OKLCH · color() · named colors · alpha

Operations

Parse · validate · convert · mix · blend · composite · interpolate · compare · repair · simulate · resolve · export

Explore every color space

Color systems

Start with one color.
Ship a complete color system.

Build related variants, named palettes, scales, harmonies, gradients, theme variants, and CSS tokens from the same immutable objects.

#806eae oklch(0.58 0.10 296) rebeccapurple
Typed color #806eae SrgbColor
Variants
Palette
Gradient
Theme--brand: #806eae

$palette->interpolate(7)->darken(0.08)->toCssVariables('theme');

See palettes, gradients, harmonies and themes

Color vision simulation

See the same palette through five profiles.

Transform the complete palette, then find meanings that rely too heavily on hue.

Explore vision simulation

Transform and repair

Produce the next palette.
Fix the pair that fails.

Dark mode transformer

Keep every application role aligned.

Transform a named light palette while preserving its keys and order.

Transform a complete palette
Light
PHPColor
Dark
PHPColor
Contrast fixer

Return a color that reaches the selected WCAG target.

Before3.98:1#3b82f6
After4.58:1#468eff
See the verified repair

Modern CSS

Resolve CSS Color 5 expressions on the server.

Keep variables and relative channel math explicit, provide the missing context, then receive a concrete typed color.

Origin#806eae
Relative expressionoklch(from var(--brand)
calc(l + 0.1) c h / alpha)
Concrete result#9e8cceOklchColor

l + 0.1 · chroma, hue and alpha unchanged

Explore relative colors

Get started

Start in thirty seconds

Zero dependencies. Zero configuration.