public void ClampUpper() { double hue = 0.13; double saturation = 1.24; double value = 0.35; var hsv = new HSV(hue, saturation, value); hsv.Clamp(); Assert.AreEqual(new HSV(hue, 1.0, value), hsv); }
public void Constructor() { double hue = 0.13; double saturation = 0.24; double value = 0.35; var hsv = new HSV(hue, saturation, value); Assert.AreEqual(hue, hsv.Hue); Assert.AreEqual(saturation, hsv.Saturation); Assert.AreEqual(value, hsv.Value); Assert.AreEqual(0.0, hsv.Alpha); }
public RGB(HSV hsv) { var tmp = hsv.GimpHSV; gimp_hsv_to_rgb(ref tmp, ref _rgb); }
public HSV(HSV hsv) { _hsv = hsv._hsv; }
public void EqualsOperator() { double hue = 0.13; double saturation = 0.24; double value = 0.35; var hsv1 = new HSV(hue, saturation, value); var hsv2 = new HSV(hue, saturation, value); Assert.IsTrue(hsv1 == hsv2); }
public void EqualsFalse() { double hue = 0.13; double saturation = 0.24; double value = 0.35; var hsv1 = new HSV(hue, saturation, value); var hsv2 = new HSV(hue + 0.1, saturation, value); Assert.IsFalse(hsv1.Equals(hsv2)); }
public void ConstructorWithHSV() { HSV hsv = new HSV(0, 0, 0); RGB rgb = new RGB(hsv); Assert.AreEqual(new RGB(0, 0, 0), rgb); }