https://github.com/danmichaelo/php-coma
Calculate various color distance metrics (delta E) such as CIE76 and CIE94
https://github.com/danmichaelo/php-coma
Last synced: 5 months ago
JSON representation
Calculate various color distance metrics (delta E) such as CIE76 and CIE94
- Host: GitHub
- URL: https://github.com/danmichaelo/php-coma
- Owner: danmichaelo
- License: mit
- Created: 2013-12-15T23:04:07.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-07-29T20:55:48.000Z (over 1 year ago)
- Last Synced: 2024-12-16T22:57:30.080Z (about 1 year ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 16
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CoMa – PHP Color Math Library
===============
[](https://travis-ci.org/danmichaelo/php-coma)
[](https://coveralls.io/r/danmichaelo/php-coma?branch=master)
[](https://packagist.org/packages/danmichaelo/coma)
[](https://packagist.org/packages/danmichaelo/coma)
Php library to convert between [sRGB](//en.wikipedia.org/wiki/SRGB), [XYZ](//en.wikipedia.org/wiki/XYZ_color_space), and [Lab](//en.wikipedia.org/wiki/Lab_color_space) color spaces, and calculate various [color distance metrics](//en.wikipedia.org/wiki/Color_difference) (delta E). Currently CIE76 and CIE94 are implemented, but I plan to implement more.
```php
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() . '.';
```