Use the default distance algorithm to turn a visual change into a comparable number:
use PhpColor\Color\Color;
$old = Color::parse('#7c3aed');
$new = Color::parse('#8145ec');
$distance = Color::distance($old, $new);
assert(abs($distance - 2.4262143194799) < 0.000001);
use PhpColor\Color\Color;
$old = Color::parse('#7c3aed');
$new = Color::parse('#8145ec');
$distance = Color::distance($old, $new);
assert(abs($distance - 2.4262143194799) < 0.000001);
A distance of 0 means identical Lab coordinates. The number is evidence about color difference, not a universal pass threshold; choose tolerances for the material, display, and review process you control.