PackageTrack
Sign in Get early access

spatie/color

A little library to handle color conversions

2.1.0 23M downloads/mo #747 most downloaded on Packagist spatie/color

What this package is like to depend on

Last release 6 months ago

08 Feb 2026

Ships unpredictably

gaps range from 8 days to 1.8 years

Most releases are documented

notes for 20 of 23 stable releases

Nothing withdrawn

no release was ever pulled

10 years old

23 releases · first in 2016

2 releases in the last 12 months

see the full history below

Release timeline

23 releases · Sep 2016 to Feb 2026
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 23
  1. 2.1.0 08 Feb 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v2.0.0...2.1.0

    Open source →
    Release notes

    What's Changed

    • ADD argb support by @enricodelazzari in https://github.com/spatie/color/pull/100

    New Contributors

    • @enricodelazzari made their first contribution in https://github.com/spatie/color/pull/100

    Full Changelog: https://github.com/spatie/color/compare/v2.0.0...2.1.0

    Open source →
  2. v2.0.0 31 Jan 2026
    Release notes

    What's Changed

    Breaking Changes

    • Require PHP 8.2 or higher (dropped support for PHP 7.x, 8.0, 8.1)
    • Removed Hsla::contrast() method (was broken)
    • Added return type hints to Color interface - custom implementations must add:
      • fromString(): static
      • red(): int|string
      • green(): int|string
      • blue(): int|string

    Improvements

    • Modernized codebase with constructor property promotion
    • Upgraded to Pest 4 and PHPUnit 11
    • Tests now run on PHP 8.2, 8.3, 8.4, and 8.5
    • Cleaned up README badges

    Full Changelog: 1.5.3...v2.0.0

    Open source →
    Release notes

    What's Changed

    Breaking Changes

    • Require PHP 8.2 or higher (dropped support for PHP 7.x, 8.0, 8.1)
    • Removed Hsla::contrast() method (was broken)
    • Added return type hints to Color interface - custom implementations must add:
      • fromString(): static
      • red(): int|string
      • green(): int|string
      • blue(): int|string

    Improvements

    • Modernized codebase with constructor property promotion
    • Upgraded to Pest 4 and PHPUnit 11
    • Tests now run on PHP 8.2, 8.3, 8.4, and 8.5
    • Cleaned up README badges

    Full Changelog: https://github.com/spatie/color/compare/1.5.3...v2.0.0

    Open source →
  3. 1.8.0 10 Feb 2025
    Release notes

    What's Changed

    • Enable alpha color conversion between Hex, Hsla, and Rgba formats by @thaqebon in #94

    New Contributors

    Full Changelog: 1.7.0...1.8.0

    Open source →
    Release notes

    What's Changed

    • Enable alpha color conversion between Hex, Hsla, and Rgba formats by @thaqebon in https://github.com/spatie/color/pull/94

    New Contributors

    • @thaqebon made their first contribution in https://github.com/spatie/color/pull/94

    Full Changelog: https://github.com/spatie/color/compare/1.7.0...1.8.0

    Open source →
  4. 1.7.0 30 Dec 2024
    Release notes

    What's Changed

    Full Changelog: 1.6.3...1.7.0

    Open source →
    Release notes

    What's Changed

    • 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

    Open source →
  5. 1.6.3 23 Dec 2024
    Release notes

    What's Changed

    • Test Enhancements for Contrast Calculations (and mini refactor for contrast class) by @danielebarbaro in #92

    New Contributors

    Full Changelog: 1.6.2...1.6.3

    Open source →
    Release notes

    What's Changed

    • Test Enhancements for Contrast Calculations (and mini refactor for contrast class) by @danielebarbaro in https://github.com/spatie/color/pull/92

    New Contributors

    • @danielebarbaro made their first contribution in https://github.com/spatie/color/pull/92

    Full Changelog: https://github.com/spatie/color/compare/1.6.2...1.6.3

    Open source →
  6. 1.6.2 09 Dec 2024
    Release notes

    What's Changed

    • Issue #88 Cast return to float instead of string to match Contrast ratio return type by @NiklasBr in #91

    New Contributors

    Full Changelog: 1.6.1...1.6.2

    Open source →
    Release notes

    What's Changed

    • 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

    New Contributors

    • @NiklasBr made their first contribution in https://github.com/spatie/color/pull/91

    Full Changelog: https://github.com/spatie/color/compare/1.6.1...1.6.2

    Open source →
  7. 1.6.1 18 Nov 2024
    Release notes

    What's Changed

    • Fix wrong Validation Error message for hsla strings by @Afrowson in #90

    New Contributors

    Full Changelog: 1.6.0...1.6.1

    Open source →
    Release notes

    What's Changed

    • Fix wrong Validation Error message for hsla strings by @Afrowson in https://github.com/spatie/color/pull/90

    New Contributors

    • @Afrowson made their first contribution in https://github.com/spatie/color/pull/90

    Full Changelog: https://github.com/spatie/color/compare/1.6.0...1.6.1

    Open source →
  8. 1.6.0 20 Sep 2024
    Release notes

    What's Changed

    • Ignore more file when packaging releases by @andypost in #83
    • Fix typo in README for Hsl::fromString() in Cast the color to a string. by @agnonym in #84
    • Added named colors by @vanodevium in #87

    New Contributors

    Full Changelog: 1.5.3...1.6.0

    Open source →
    Release notes

    What's Changed

    • Ignore more file when packaging releases by @andypost in https://github.com/spatie/color/pull/83
    • Fix typo in README for Hsl::fromString() in Cast the color to a string. by @agnonym in https://github.com/spatie/color/pull/84
    • Added named colors by @vanodevium in https://github.com/spatie/color/pull/87

    New Contributors

    • @andypost made their first contribution in https://github.com/spatie/color/pull/83
    • @agnonym made their first contribution in https://github.com/spatie/color/pull/84
    • @vanodevium made their first contribution in https://github.com/spatie/color/pull/87

    Full Changelog: https://github.com/spatie/color/compare/1.5.3...1.6.0

    Open source →
  9. 1.5.3 18 Dec 2022
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 1.5.2...1.5.3

    Open source →
    Release notes

    What's Changed

    • Refactor tests to pest by @AyoobMH in https://github.com/spatie/color/pull/80
    • Add PHP 8.2 Support by @patinthehat in https://github.com/spatie/color/pull/81
    • Fix rgb to cmyk division by zero bug by @stefanriehl in https://github.com/spatie/color/pull/82

    New Contributors

    • @AyoobMH made their first contribution in https://github.com/spatie/color/pull/80
    • @patinthehat made their first contribution in https://github.com/spatie/color/pull/81
    • @stefanriehl made their first contribution in https://github.com/spatie/color/pull/82

    Full Changelog: https://github.com/spatie/color/compare/1.5.2...1.5.3

    Open source →
  10. 1.5.2 24 Jun 2022
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 1.5.1...1.5.2

    Open source →
    Release notes

    What's Changed

    • Add RegEx fix to Validate.php too... by @jcogs-design in https://github.com/spatie/color/pull/73
    • Fix typo in Distance::CIE76. by @Angel5a in https://github.com/spatie/color/pull/76

    New Contributors

    • @jcogs-design made their first contribution in https://github.com/spatie/color/pull/73
    • @Angel5a made their first contribution in https://github.com/spatie/color/pull/76

    Full Changelog: https://github.com/spatie/color/compare/1.5.1...1.5.2

    Open source →
  11. 1.5.1 12 Apr 2022

    Nothing published for this version

  12. 1.5.0 11 Jan 2022

    Nothing published for this version

  13. v1.3.0 06 Sep 2021
    Release notes
    • Added CIELab and XYZ color formats and Distance API
    • Added Contrast API
    Open source →
  14. 1.2.4 18 Feb 2021
    Release notes
    • Fixed division by zero error on pure white/black convertions (#42)
    Open source →
  15. 1.2.2 18 Nov 2020
    Release notes
    • Fix transform RGB value to HSL : division by zero (#38)
    Open source →
  16. 1.2.1 17 Jul 2020
    Release notes
    • HSL to RGB fixes
    Open source →
  17. 1.2.0 22 Jun 2020
    Release notes
    • Added HSL & HSLA support
    Open source →
  18. 1.1.1 03 Feb 2017
    Release notes
    • Fixed validation when a color contained redundant characters at the beginning or end of the string
    Open source →
  19. 1.1.0 26 Jan 2017
    Release notes
    • All color formats now implement a Color interface
    • Added a Factory class with a fromString static method to guess a format
    • rgb and rgba values can now contain spaces (e.g. rgb(255, 255, 255))
    Open source →
  20. 1.0.2 17 Oct 2016
    Release notes
    • rgbChannelToHexChannel now also accepts single single-digit hex values
    Open source →
  21. 1.0.1 22 Sep 2016
    Release notes
    • Bugfix (breaking!): Alpha channel values are now a float between 0 and 1
    Open source →
  22. 1.0.0 20 Sep 2016
    Release notes
    • First release
    Open source →
  23. 0.1.0 20 Sep 2016

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive