danmichaelo / coma
Library to convert colors between the RGB, XYZ, and Lab colorspaces, and to calculate color distance metrics such as CIE76 and CIE94
Installs: 21 339
Dependents: 1
Suggesters: 0
Security: 0
Stars: 16
Watchers: 6
Forks: 3
Open Issues: 0
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: dev-master
This package is auto-updated.
Last update: 2024-10-29 21:35:20 UTC
README
Php library to convert between sRGB, XYZ, and Lab color spaces, and calculate various color distance metrics (delta E). Currently CIE76 and CIE94 are implemented, but I plan to implement more.
use Danmichaelo\Coma\ColorDistance, Danmichaelo\Coma\sRGB; $color1 = new sRGB(1, 5, 250); $color2 = new sRGB(0, 0, 208); $cd = new ColorDistance; $cie94 = $cd->cie94($color1, $color2); echo 'The CIE94 ∆E is ' . $cie94 . ' between ' . $color1->toHex() . ' and ' . $color2->toHex() . '.';