ozdemirburak/iris
PHP library for color manipulation and conversion.
20 Releases
Latest: 4mo ago
4.1.1Latest
Fixes incorrect param type for PHPStan.
4.1.0
📋 Changes
- Supports two-color gradients: $colorA->gradient($colorB, $steps)
- Supports multi-color gradients with pivots: $colorA->gradient([$colorB, $colorC], $steps)
- Works with all color types (Hex, RGB, HSL, HSV, CMYK, OKLCH, RGBA, HSLA)
- Returns array of colors matching the starting color type
- Added comprehensive tests for all color types and edge cases
4.0.1
📋 Changes
- Support CSS Color Level 4 space-separated syntax: oklch(40.1% 0.123 21.57)
- Continue supporting comma-separated syntax: oklch(70%, 0.15, 150)
- Alpha values in input are parsed but ignored (e.g., oklch(50% 0.1 180 / .5))
4.0.0
💥 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
3.1.1
📋 Changes
- Using float instead of int to avoid warnings @jaulz
3.1.0
📋 Changes
- Use float instead of int to avoid warnings @jaulz
- Fixes for issues #39
2.5.0
📋 Changes
- Made BaseColor::back() and BaseColor::getColorModelName() public, added mixInHsv() @rv1971
- Use non-locale aware output for the alpha value @Jako
- Updated .gitignore, and some code refactoring @kudashevs
3.0.0
📋 Changes
- Remove PHP 7 support, will only support PHP 8
- Added type hinting and return type declarations
- Made BaseColor::back() and BaseColor::getColorModelName() public @rv1971
- Use non-locale aware output for the alpha value @Jako
- Updated .gitignore, and some code refactoring @kudashevs
2.4.0
Added new Hexa class, fixes issue #28, thanks to @amnuts.
2.3.1
Changed HSL to HSV conversion method, fixes issue #27.
2.3.0
📋 Changes
- Support PHP 8.0, fixes issue #26.
2.2.0
📋 Changes
- Added [fade](https://github.com/ozdemirburak/iris#fade), [fadeIn](https://github.com/ozdemirburak/iris#fadein), and [fadeOut](https://github.com/ozdemirburak/iris#fadeout) methods.
2.1.0
📋 Changes
- Remove PHP 7.1 support
- Allow more than two precision for alpha @dtSniper
2.0.1
📋 Changes
- Added full list of CSS colours, thanks to @amnuts.
2.0.0
📋 Changes
- Remove support for PHP 7.0 and below
- Added new [factory method](https://github.com/ozdemirburak/iris#via-factory) for detecting and parsing color format when format is unknown @amnuts
- Upgrade to phpunit 8, updated tests for phpunit 9 deprecations.
1.2.1
Added tint and shade methods.
1.2.0
Added `isLight` and `isDark` methods.
1.1.1
Improved code coverage.
1.1.0
1.0.0
