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.
$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);