public void Convert_Hsl_To_Rgb(float h, float s, float l, float r, float g, float b) { // Arrange var input = new Hsl(h, s, l); var expected = new Rgb(r, g, b); Span <Hsl> inputSpan = new Hsl[5]; inputSpan.Fill(input); Span <Rgb> actualSpan = new Rgb[5]; // Act var actual = Converter.ToRgb(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(Rgb.DefaultWorkingSpace, actual.WorkingSpace, ColorSpaceComparer); Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_Hsl_to_CieXyy(float h, float s, float l, float x, float y, float yl) { // Arrange var input = new Hsl(h, s, l); var expected = new CieXyy(x, y, yl); Span <Hsl> inputSpan = new Hsl[5]; inputSpan.Fill(input); Span <CieXyy> actualSpan = new CieXyy[5]; // Act var actual = Converter.ToCieXyy(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_Hsl_to_Cmyk(float h, float s, float l, float c, float m, float y, float k) { // Arrange var input = new Hsl(h, s, l); var expected = new Cmyk(c, m, y, k); Span <Hsl> inputSpan = new Hsl[5]; inputSpan.Fill(input); Span <Cmyk> actualSpan = new Cmyk[5]; // Act var actual = Converter.ToCmyk(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_Hsl_to_CieLch(float h2, float s, float l2, float l, float c, float h) { // Arrange var input = new Hsl(h2, s, l2); var expected = new CieLch(l, c, h); Span <Hsl> inputSpan = new Hsl[5]; inputSpan.Fill(input); Span <CieLch> actualSpan = new CieLch[5]; // Act var actual = Converter.ToCieLch(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_Hsl_to_CieLab(float h, float s, float ll, float l, float a, float b) { // Arrange var input = new Hsl(h, s, ll); var expected = new CieLab(l, a, b); Span <Hsl> inputSpan = new Hsl[5]; inputSpan.Fill(input); Span <CieLab> actualSpan = new CieLab[5]; // Act var actual = Converter.ToCieLab(input); Converter.Convert(inputSpan, actualSpan, actualSpan.Length); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }