public function cie76($color1, $color2)
    {
        $f1 = $this->toLab($color1);
        $f2 = $this->toLab($color2);

        $deltaL = $f2->l - $f1->l;
        $deltaA = $f2->a - $f1->a;
        $deltaB = $f2->b - $f1->b;

        $deltaE = $deltaL * $deltaL + $deltaA * $deltaA + $deltaB * $deltaB;

        return $deltaE < 0 ? 0 : sqrt($deltaE);
    }
public function cie76($color1, $color2)
    {
        $f1 = $this->toLab($color1);
        $f2 = $this->toLab($color2);

        $deltaL = $f2->l - $f1->l;
        $deltaA = $f2->a - $f1->a;
        $deltaB = $f2->b - $f1->b;

        $deltaE = $deltaL * $deltaL + $deltaA * $deltaA + $deltaB * $deltaB;

        return $deltaE < 0 ? 0 : sqrt($deltaE);
    }
public function cie76 ( $ color1 , $ color2 ) { $ f1 = $ this -> toLab ( $ color1 ) ; $ f2 = $ this -> toLab ( $ color2 ) ; $ deltaL = $ f2 -> l - $ f1 -> l ; $ deltaA = $ f2 -> a - $ f1 -> a ; $ deltaB = $ f2 -> b - $ f1 -> b ; $ deltaE = $ deltaL * $ deltaL + $ deltaA * $ deltaA + $ deltaB * $ deltaB ; return $ deltaE < 0 ? 0 : sqrt ( $ deltaE ) ; }
DeltaE calculation using the CIE76 formula.
Delta = 2.3 corresponds to a just noticeable difference.

1. assume that your RGB values are in the sRGB colorspace
2. convert sRGB colors to L*a*b*
3. compute deltaE between your two L*a*b* values.
DeltaE calculation using the CIE76 formula . Delta = 2 . 3 corresponds to a just noticeable difference .