Exemplo n.º 1
0
        public void GetClampedTest()
        {
            ColorRGB input = new ColorRGB(2.0f, -3.0f, 0.5f, 1.0f);
            ColorRGB expected = new ColorRGB(1.0f, 0.0f, 0.5f, 1.0f);

            ColorRGB actual = input.GetClamped();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void CompressTest()
        {
            ColorRGB actual = new ColorRGB(2.0f, 1.0f, 0.5f, 1.0f);
            ColorRGB expected = new ColorRGB(1.0f, 0.5f, 0.25f, 0.5f);

            actual.Normalize();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void ClampTest()
        {
            ColorRGB actual = new ColorRGB(2.0f, -3.0f, 0.5f, 1.0f);
            ColorRGB expected = new ColorRGB(1.0f, 0.0f, 0.5f, 1.0f);

            actual.Clamp();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void GetCompressedShouldEqualCompress()
        {
            ColorRGB input = new ColorRGB(1.5f, 0.4f, -51.5f, 0.0f);

            ColorRGB compress = input.GetCompressed();
            input.Normalize();

            bool expected = true;
            bool actual = compress == input;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 5
0
        public void GetClampedShouldEqualClamp()
        {
            ColorRGB input = new ColorRGB(1.5f, 0.4f, -51.5f, 0.0f);

            ColorRGB clamp = input.GetClamped();
            input.Clamp();

            bool expected = true;
            bool actual = clamp == input;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Indicates whether this instance and a specified <see cref="ColorRGB"/> are equal.
 /// </summary>
 /// <param name="other">A <see cref="ColorRGB"/> instance to compare.</param>
 /// <returns>true if both instances represent the same value; otherwise, false.</returns>
 public bool Equals(ColorRGB other)
 {
     return this == other;
 }
Exemplo n.º 7
0
 public static ColorRGB Clamp(ColorRGB color)
 {
     color.Clamp();
     return color;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Indicates whether this instance and a specified <see cref="ColorRGB"/> are equal.
 /// </summary>
 /// <param name="other">A <see cref="ColorRGB"/> instance to compare.</param>
 /// <returns>true if both instances represent the same value; otherwise, false.</returns>
 public bool Equals(ColorRGB other)
 {
     return(this == other);
 }
Exemplo n.º 9
0
 public static ColorRGB Clamp(ColorRGB color)
 {
     color.Clamp();
     return(color);
 }