Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 /// <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;
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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);
        }