NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #752 most downloaded on Packagist
A little library to handle color conversions
Latest stable
2.1.0
Last release 9 months ago
08 Feb 2026
Ships unpredictably
gaps range from 8 days to 1.8 years
Nearly every release is documented
notes for 21 of 23 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
23 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
ADD argb support by @enricodelazzari in https://github.com/spatie/color/pull/100
Full Changelog: https://github.com/spatie/color/compare/v2.0.0...2.1.0
Require PHP 8.2 or higher (dropped support for PHP 7.x, 8.0, 8.1)
Hsla::contrast() method (was broken)Color interface - custom implementations must add:
fromString(): staticred(): int|stringgreen(): int|stringblue(): int|stringFull Changelog: https://github.com/spatie/color/compare/1.5.3...v2.0.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Enable alpha color conversion between Hex, Hsla, and Rgba formats by @thaqebon in https://github.com/spatie/color/pull/94
Full Changelog: https://github.com/spatie/color/compare/1.7.0...1.8.0
Extended HSL/HSLA/HSB Handling with Float Support by @danielebarbaro in https://github.com/spatie/color/pull/93
Full Changelog: https://github.com/spatie/color/compare/1.6.3...1.7.0
Test Enhancements for Contrast Calculations (and mini refactor for contrast class) by @danielebarbaro in https://github.com/spatie/color/pull/92
Full Changelog: https://github.com/spatie/color/compare/1.6.2...1.6.3
Issue #88 Cast return to float instead of string to match Contrast ratio return type by @NiklasBr in https://github.com/spatie/color/pull/91
Full Changelog: https://github.com/spatie/color/compare/1.6.1...1.6.2
Fix wrong Validation Error message for hsla strings by @Afrowson in https://github.com/spatie/color/pull/90
Full Changelog: https://github.com/spatie/color/compare/1.6.0...1.6.1
Ignore more file when packaging releases by @andypost in https://github.com/spatie/color/pull/83
Full Changelog: https://github.com/spatie/color/compare/1.5.3...1.6.0
Refactor tests to pest by @AyoobMH in https://github.com/spatie/color/pull/80
Full Changelog: https://github.com/spatie/color/compare/1.5.2...1.5.3
Add RegEx fix to Validate.php too... by @jcogs-design in https://github.com/spatie/color/pull/73
Full Changelog: https://github.com/spatie/color/compare/1.5.1...1.5.2
Fix rgba opacity by @AstroCorp in https://github.com/spatie/color/pull/67
Full Changelog: https://github.com/spatie/color/compare/1.5.0...1.5.1
Nothing published for this version
Added CIELab and XYZ color formats and Distance API
Distance APIContrast APIFixed division by zero error on pure white/black convertions
Fix transform RGB value to HSL : division by zero
- HSL to RGB fixes
- Added HSL & HSLA support
Fixed validation when a color contained redundant characters at the beginning or end of the string
Rgb and rgba strings can now contain spaces
Color interfaceFactory class that can create a color from a string in any formatColor interfaceFactory class with a fromString static method to guess a formatrgb and rgba values can now contain spaces (e.g. rgb(255, 255, 255))rgbChannelToHexChannel now also accepts single single-digit hex values
rgbChannelToHexChannel now also accepts single single-digit hex valuesBugfix (breaking!): Alpha channel values are now a float between 0 and 1
- First release
Nothing published for this version
One column per quarter.