Example #1
0
 public static Color4f ToColor4f(this IColor4 c)
 {
     if (c is Color4f)
     {
         return((Color4f)c);
     }
     return(new Color4f(c));
 }
Example #2
0
 public static Color4b ToColor4b(this IColor4 c)
 {
     if (c is Color4b)
     {
         return((Color4b)c);
     }
     return(new Color4b(c));
 }
Example #3
0
        public Color4b(IColor4 other)
        {
            ITuple4_Byte _other = other.AsTupleByte();

            this.Red   = _other.X;
            this.Green = _other.Y;
            this.Blue  = _other.Z;
            this.Alpha = _other.W;
        }
Example #4
0
        public Color4f(IColor4 other)
        {
            ITuple4_Float _other = other.AsTupleFloat();

            this.Red   = _other.X;
            this.Green = _other.Y;
            this.Blue  = _other.Z;
            this.Alpha = _other.W;
        }
Example #5
0
        public static ITuple4_Byte AsTupleByte(this IColor4 v)
        {
            ITuple4_Byte ret = v as ITuple4_Byte;

            if (ret != null)
            {
                return(ret);
            }
            return(VectorUtils.Convert <ITuple4_Byte>(v));
        }
Example #6
0
        public static ITuple4_Float AsTupleFloat(this IColor4 v)
        {
            ITuple4_Float ret = v as ITuple4_Float;

            if (ret != null)
            {
                return(ret);
            }
            return(VectorUtils.Convert <IColor4, ITuple4_Float>(v));
        }
Example #7
0
        bool IEquatable <IColor4> .Equals(IColor4 other)
        {
            ITuple4_Byte _other = other.AsTupleByte();

            return(this.Equals(_other.X, _other.Y, _other.Z, _other.W));
        }
Example #8
0
        bool IEpsilonEquatable <IColor4> .EpsilonEquals(IColor4 other, double epsilon)
        {
            ITuple4_Byte _other = other.AsTupleByte();

            return(this.EpsilonEquals(_other.X, _other.Y, _other.Z, _other.W, (byte)epsilon));
        }
Example #9
0
        bool IEpsilonEquatable <IColor4> .EpsilonEquals(IColor4 other, double epsilon)
        {
            ITuple4_Float _other = other.AsTupleFloat();

            return(this.EpsilonEquals(_other.X, _other.Y, _other.Z, _other.W, (float)epsilon));
        }