Beispiel #1
0
func TestCIE2000Data(t *testing.T) {
	for _, c := range colorCases {
		result := CIE2000(c.ref, c.sample, &KLChDefault)
		resultBa := CIE2000(c.ref, c.sample, &KLChDefault)

		if resultBa != result {
			t.Errorf("Asymmetry for %v, %v (%v != %v)", c.ref, c.sample, result, resultBa)
		}
		testnum.AlmostEqual(t, result, c.expectedCIE2000, 4, fmt.Sprintf("%v, %v", c.ref, c.sample))
	}
}
Beispiel #2
0
func TestCIE2000_1(t *testing.T) {
	expected := 1.523
	c1, c2 := Lab{0.9, 16.3, -2.22}, Lab{0.7, 14.2, -1.80}
	result := CIE2000(c1, c2, &KLChDefault)
	testnum.AlmostEqual(t, result, expected, 3, fmt.Sprintf("%v, %v", c1, c2))
}
Beispiel #3
0
func TestCIE2000_2(t *testing.T) {
	c1, c2 := Lab{32.8911, -53.0107, -43.3182}, Lab{77.1797, 25.5928, 17.9412}
	expected := 78.772
	result := CIE2000(c1, c2, &KLChDefault)
	testnum.AlmostEqual(t, result, expected, 3, fmt.Sprintf("%v, %v", c1, c2))
}