conkal / color
Color manipulation library
v0.1.0
2022-05-03 13:49 UTC
Requires (Dev)
- phpunit/phpunit: >5.7
This package is auto-updated.
Last update: 2024-12-07 19:23:33 UTC
README
Color
Installation
composer require conkal/color
fromHex
$color = Color::fromHex('#990000');
lighten
// lighten by 10% $color = Color::fromHex('#990000')->lighten(30);
darken
// darken by 10% $color = Color::fromHex('#990000')->darken(30);
shades
gives an array of colors
$colors = Color::fromHex('#990000')->shades(3);0=>#990000 1=>#cc0000 2=>#ff0000 3=>#ff0000 -1=>#650000 -2=>#320000 -3=>#000000
invert
$color = Color::fromHex('#ff0000')->invert();