/** * Get distance from the given color using the Delta E method * * @param Jetpack_Color $color * * @return float */ public function getDistanceLabFrom(Jetpack_Color $color) { $lab1 = $this->toLabCie(); $lab2 = $color->toLabCie(); $lDiff = abs($lab2['l'] - $lab1['l']); $aDiff = abs($lab2['a'] - $lab1['a']); $bDiff = abs($lab2['b'] - $lab1['b']); $delta = sqrt($lDiff + $aDiff + $bDiff); return $delta; }