Skip to content

4.0.0

Choose a tag to compare

@ozdemirburak ozdemirburak released this 02 Dec 14:21
· 7 commits to master since this release

A major release bringing modern PHP support and a new color space. This version requires PHP 8.1+ and introduces OKLCH, a perceptually uniform color space, which is ideal for creating accessible color palettes and smooth gradients.

Breaking Changes

  • Minimum PHP version is now 8.1
  • Removed Travis CI configuration
  • Removed EditorConfig and PHP CodeSniffer

New Features

  • OKLCH Color Space: Added full support for the perceptually uniform OKLCH color format
  • Parse OKLCH strings: new Oklch('oklch(70%, 0.15, 150)')
  • Convert any color to OKLCH: $hex->toOklch()
  • Convert OKLCH to all other formats (Hex, RGB, HSL, etc.)
  • Factory support for OKLCH strings

Bug Fixes

  • Fixed RGBA to HEXA conversion preserving original RGB values (#37)
  • Fixed HSLA to HEXA conversion preserving original alpha value (#48)

Improvements

  • Updated PHPUnit to ^10.5|^11.0
  • Converted all test annotations to PHP 8 attributes

Currently Supported Formats

Hex, Hexa, RGB, RGBA, HSL, HSLA, HSV, CMYK, OKLCH