public void ShouldInitializeTheProperties() { var color = new MagickColor(Quantum.Max, Quantum.Max, (QuantumType)(Quantum.Max * 0.02)); var hslColor = ColorHSL.FromMagickColor(color); Assert.AreEqual(0.16, hslColor.Hue, 0.01); Assert.AreEqual(0.5, hslColor.Lightness, 0.01); Assert.AreEqual(1.0, hslColor.Saturation, 0.01); }
public void ShouldInitializeTheProperties() { var color = new MagickColor(Quantum.Max, Quantum.Max, (QuantumType)(Quantum.Max * 0.02)); var hslColor = ColorHSL.FromMagickColor(color); Assert.InRange(hslColor.Hue, 0.16, 0.17); Assert.InRange(hslColor.Lightness, 0.5, 0.6); Assert.InRange(hslColor.Saturation, 0.10, 1.1); }
public void ShouldReturnNullWhenValueIsNull() { var result = ColorHSL.FromMagickColor(null); Assert.Null(result); }