mattacosta / php-colordiff
Provides functions to convert and compare colors.
Installs: 465
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 2
Open Issues: 2
pkg:composer/mattacosta/php-colordiff
This package is auto-updated.
Last update: 2022-03-07 02:02:48 UTC
README
Implements utility functions to compute the difference between colors and to convert between different color models, such as RGB and CIELAB.
For more information on delta E functions, see Color difference.
Example
$color1 = ['r' => 255, 'g' => 0, 'b' => 255]; // Magenta $color2 = ['r' => 220, 'g' => 20, 'b' => 60]; // Crimson $color1 = ColorDiff::xyz2cielab(ColorDiff::rgb2xyz($color1)); $color2 = ColorDiff::xyz2cielab(ColorDiff::rgb2xyz($color2)); $difference = ColorDiff::deltaE2000($color1, $color2);