Color Creation

Turn external values and explicit channels into valid, immutable color objects.

Parse modern color formats

Turn supported concrete CSS color formats into typed objects through one parsing boundary.

Explore Parsing
<?php

use PhpColor\Color\Color;

$color = Color::parse('oklch(0.68 0.18 264)');
use PhpColor\Color\Color; $color = Color::parse('oklch(0.68 0.18 264)');

Construct typed colors

Create the intended color-space object directly when numeric channels already have an explicit meaning.

Explore Construction
sRGBr 0.23 · g 0.51 · b 0.96
OKLCHl 0.62 · c 0.19 · h 260

Validate CSS color input

Choose nullable parsing or exceptions when CSS color input crosses an application boundary.

Explore Validation
#806eaeaccepted
not-a-colorrejected

Keep building

Turn input into typed color objects