deltaE function

double deltaE(
  1. LabColor lab1,
  2. LabColor lab2, {
  3. DeltaEAlgorithm algorithm = DeltaEAlgorithm.ciede2000,
  4. Weights weights = const Weights(),
})

Calculates the color difference between lab1 and lab2.

The weights parameter is only taken into account if algorithm isn't set to DeltaEAlgorithm.cie76.

Implementation

double deltaE(
  LabColor lab1,
  LabColor lab2, {
  DeltaEAlgorithm algorithm = DeltaEAlgorithm.ciede2000,
  Weights weights = const Weights(),
}) {
  switch (algorithm) {
    case DeltaEAlgorithm.cie76:
      return deltaE76(lab1, lab2);
    case DeltaEAlgorithm.cie94:
      return deltaE94(lab1, lab2, weights);
    case DeltaEAlgorithm.ciede2000:
    default:
      return deltaE00(lab1, lab2, weights);
  }
}