ColorDifference Class
Color difference metrics (ΔE): how different two colors look, as a distance in CIELAB or Oklab. A difference of about 1 in CIELAB (about 0.02 in Oklab) is just noticeable.
public static class ColorDifferenceRemarks
The metrics take the colors as they are: give them relative to the same white (CieLab.FromRgb gives D50). ColorDifference.DeltaE94 is not symmetric: its weights come from the reference color.
Methods
| Name | Description |
|---|---|
| DeltaE2000(CieLab, CieLab, double, double, double) | Computes the CIEDE2000 color difference (ΔE00, CIE 142-2001), as Sharma, Wu and Dalal state its equations ("The CIEDE2000 color-difference formula: implementation notes, supplementary test data, and mathematical observations", 2005). |
| DeltaE76(CieLab, CieLab) | Computes the CIE 1976 color difference (ΔE*ab, ΔE76): the Euclidean distance in CIELAB. |
| DeltaE94(CieLab, CieLab, Cie94Application) | Computes the CIE 1994 color difference (ΔE*94, CIE 116-1995): the differences of lightness, chroma and hue, weighted by the chroma of the reference color. |
| DeltaEOK(Oklab, Oklab) | Computes the Oklab color difference (ΔEOK, CSS Color 4 section 13.1.2): the Euclidean distance in Oklab. |
DeltaE2000(CieLab, CieLab, double, double, double)
ColorDifference.csComputes the CIEDE2000 color difference (ΔE00, CIE 142-2001), as Sharma, Wu and Dalal state its equations ("The CIEDE2000 color-difference formula: implementation notes, supplementary test data, and mathematical observations", 2005).
public static double DeltaE2000(CieLab reference, CieLab sample, double lightnessWeight = 1d, double chromaWeight = 1d, double hueWeight = 1d)Parameters
referenceCieLab- The first color.
sampleCieLab- The second color.
lightnessWeightdouble- The parametric factor kL of the viewing conditions. Defaults to 1.
chromaWeightdouble- The parametric factor kC of the viewing conditions. Defaults to 1.
hueWeightdouble- The parametric factor kH of the viewing conditions. Defaults to 1.
Returns
double The difference. It is symmetric.
DeltaE76(CieLab, CieLab)
ColorDifference.csDeltaE94(CieLab, CieLab, Cie94Application)
ColorDifference.csComputes the CIE 1994 color difference (ΔE*94, CIE 116-1995): the differences of lightness, chroma and hue, weighted by the chroma of the reference color.
public static double DeltaE94(CieLab reference, CieLab sample, Cie94Application application = Cie94Application.GraphicArts)Parameters
referenceCieLab- The reference color, whose chroma weights the differences.
sampleCieLab- The color compared with the reference.
applicationCie94Application- The weights of the kind of samples compared.
Returns
double The difference.
Exceptions
ArgumentOutOfRangeExceptionapplicationis not a defined value.
DeltaEOK(Oklab, Oklab)
ColorDifference.csComputes the Oklab color difference (ΔEOK, CSS Color 4 section 13.1.2): the Euclidean distance in Oklab.