示例#1
0
        public static QuadColor operator *(QuadColor A, double B)
        {
            QuadColor quadColor = new QuadColor(A.A * B, A.R * B, A.G * B, A.B * B);

            quadColor.ClampToMax();
            return(quadColor);
        }
示例#2
0
        public static QuadColor operator *(QuadColor A, QuadColor B)
        {
            QuadColor quadColor = new QuadColor(A.A * B.A, A.R * B.R, A.G * B.G, A.B * B.B);

            quadColor.ClampToMax();
            return(quadColor);
        }
示例#3
0
        public static QuadColor operator -(QuadColor A, QuadColor B)
        {
            QuadColor quadColor = new QuadColor(A.A - B.A, A.R - B.R, A.G - B.G, A.B - B.B);

            quadColor.ClampToMin();
            return(quadColor);
        }
示例#4
0
        public static QuadColor operator +(QuadColor A, QuadColor B)
        {
            QuadColor quadColor = new QuadColor(A.A + B.A, A.R + B.R, A.G + B.G, A.B + B.B);

            quadColor.ClampToMax();
            return(quadColor);
        }
示例#5
0
        public static QuadColor operator /(QuadColor A, QuadColor B)
        {
            QuadColor quadColor = A;

            quadColor.A = (B.A == 0) ? 1.0 : A.A / B.A;
            quadColor.R = (B.R == 0) ? 1.0 : A.R / B.R;
            quadColor.G = (B.G == 0) ? 1.0 : A.G / B.G;
            quadColor.B = (B.B == 0) ? 1.0 : A.B / B.B;

            return(quadColor);
        }
示例#6
0
        public QuadColor Lerp(QuadColor A, double dist)
        {
            QuadColor result = new QuadColor((A.R - this.R) * dist + this.R,
                                             (A.G - this.G) * dist + this.G,
                                             (A.B - this.B) * dist + this.B,
                                             (A.A - this.A) * dist + this.A
                                             );

            result.ClampToMin();
            result.ClampToMax();
            return(result);
        }