cie76ColorDifference method

bool cie76ColorDifference(
  1. LABColor color, {
  2. double tolerance = 2.3,
})

Calculate color difference using cie76 standard.

@color: color is a color of type LAB.

@tolerance: tolerance is the tolerance value between two colors, the default is 2.3 which is the smallest perceivable difference for human vision.

Implementation

bool cie76ColorDifference(
  LABColor color, {
  double tolerance = 2.3,
}) {
  final double deltaL = l - color.l;
  final double deltaA = a - color.a;
  final double deltaB = b - color.b;
  final double deltaE =
      sqrt(pow(deltaL, 2) + pow(deltaA, 2) + pow(deltaB, 2));
  return deltaE > tolerance;
}