georgec / colour
Parse and manipulate CSS colour strings
1.0.0
2024-05-15 19:40 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2025-06-13 02:22:55 UTC
README
Parse and manipulate CSS colour string from PHP.
Supported formats
- 3 digit hex
- 6 digit hex
- 9 digit hex
- RGB
- HSL
- Named colours
Usage
Install with composer require georgec/colour
.
use Gc\Colour\Colour;
$initialColour = new Colour("rgb(188 93 27)");
$hexColour = $initialColour->asHex();
$hexColour->format(); // #bc5d1b
Contributing
Please send patches to my public-inbox mailing list.
Also see the issue tracker.