biano / coma
Library to convert colors between the RGB, XYZ, and Lab colorspaces, and to calculate color distance metrics such as CIE76 and CIE94
1.1.0
2024-06-18 10:42 UTC
Requires
- php: ^8.1
Requires (Dev)
- biano/coding-standard: ^4.1
- ergebnis/composer-normalize: ^2.43
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^11.0
- roave/security-advisories: dev-latest
- shipmonk/composer-dependency-analyser: ^1.5
- squizlabs/php_codesniffer: ^3.10
This package is auto-updated.
Last update: 2024-10-18 12:21:36 UTC
README
Php library to convert between sRGB, XYZ, and Lab color spaces, and calculate various color distance metrics (delta E).
Currently CIE76, CIE94 and CIEDE2000 are implemented.
use Biano\Coma\ColorDistance; use Biano\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() . '.';