private IdenticonStyle(IdenticonStyle otherStyleToClone) { hues = new HueCollection(otherStyleToClone.hues); backColor = otherStyleToClone.backColor; padding = otherStyleToClone.padding; colorSaturation = otherStyleToClone.colorSaturation; grayscaleSaturation = otherStyleToClone.grayscaleSaturation; colorLightness = otherStyleToClone.colorLightness; grayscaleLightness = otherStyleToClone.grayscaleLightness; }
/// <summary> /// Creates a new <see cref="IdenticonStyle"/> instance initialized with the default /// values of each property. /// </summary> public IdenticonStyle() { hues = new HueCollection(); backColor = DefaultBackColor; padding = DefaultPadding; colorSaturation = DefaultColorSaturation; grayscaleSaturation = DefaultGrayscaleSaturation; colorLightness = DefaultColorLightness; grayscaleLightness = DefaultGrayscaleLightness; }
public void Normalize(float expectedTurns, string expectedString, float value, HueUnit?unit) { var collection = new HueCollection(); if (unit == null) { collection.Add(value); } else { collection.Add(value, unit.Value); } Assert.AreEqual(expectedTurns, collection[0], 0.01f); Assert.AreEqual(expectedString, collection.ToString()); }
public void Remove() { var collection = new HueCollection(); collection.Add(180, HueUnit.Degrees); Assert.AreEqual(1, collection.Count); collection.Remove(0.57f); collection.Remove(0.57f, HueUnit.Turns); Assert.AreEqual(1, collection.Count); collection.Remove(0.5f, HueUnit.Turns); Assert.AreEqual(0, collection.Count); }