package lrgb import ( "math" "testing" "smariot.com/color/internal/helper" ) func eq(c0, c1 Color) bool { return helper.EqFloat64SliceFuzzy( []float64{c0.R, c0.G, c0.B}, []float64{c1.R, c1.G, c1.B}, ) } func midpoint(c0, c1 Color) Color { return Color{(c0.R + c1.R) / 2, (c0.G + c1.G) / 2, (c0.B + c1.B) / 2} } func TestModel(t *testing.T) { helper.TestModel(t, false, Model, eq, []helper.ConvertTest[Color]{ { Name: "passthrough", In: Color{math.Inf(1), math.Inf(-1), math.NaN()}, Out: Color{math.Inf(1), math.Inf(-1), math.NaN()}, }, }) } func TestDistance(t *testing.T) { helper.TestDistance(t, false, midpoint, Distance, Model) }