public void TestHSLGreenColor() { var color = Color.FromRgb(0, 255, 0); var newColorHex = PixelColor.FromHSL(255, 120, 1, 0.5); Assert.IsTrue(color.R == newColorHex.Red, "Red is not good"); Assert.IsTrue(color.G == newColorHex.Green, "Green is not good"); Assert.IsTrue(color.B == newColorHex.Blue, "Blue is not good"); Assert.IsTrue(color.A == newColorHex.Alpha, "Alpha is not good"); }
public void TestGreenColorAllFormats() { var color = Color.FromRgb(0, 255, 0); var newcolor = new PixelColor(0, 255, 0); var newColorHex = PixelColor.FromHex("#00FF00"); var newColorHSL = PixelColor.FromHSL(255, 120, 1, 0.5); Assert.IsTrue(color.R == newcolor.Red, "Red is not good"); Assert.IsTrue(color.G == newcolor.Green, "Green is not good"); Assert.IsTrue(color.B == newcolor.Blue, "Blue is not good"); Assert.IsTrue(color.A == newcolor.Alpha, "Alpha is not good"); Assert.IsTrue(color.R == newColorHex.Red, "Red is not good in HEX"); Assert.IsTrue(color.G == newColorHex.Green, "Green is not good in HEX"); Assert.IsTrue(color.B == newColorHex.Blue, "Blue is not good in HEX"); Assert.IsTrue(color.A == newColorHex.Alpha, "Alpha is not good in HEX"); Assert.IsTrue(color.R == newColorHSL.Red, "Red is not good in HSL"); Assert.IsTrue(color.G == newColorHSL.Green, "Green is not good in HSL"); Assert.IsTrue(color.B == newColorHSL.Blue, "Blue is not good in HSL"); Assert.IsTrue(color.A == newColorHSL.Alpha, "Alpha is not good in HSL"); }