Just 3kb - Simple. Fast. Easy to use. This JavaScript function accepts both RGB and hexadecimal color formats and computes the color difference using the CIE ΔE 2000 formula and the standard illuminant D65 :
// Example usage:
var delta_e = ciede_2000('#00F', '#483D8B');
For reference, the contrast between lime green (#9f0
) and dark navy (#006
) yields a ΔE2000 value of 119.
var delta_e = ciede_2000('#000', '#FFF');
var delta_e = ciede_2000('#483d8b', 75, 0, 130);
var delta_e = ciede_2000(75, 0, 130, '#00008b');
var delta_e = ciede_2000(0, 0, 139, 0, 0, 128);