Exemple #1
0
 public Color32(Color256 colour)
 {
     this.R = (byte)(colour.R * MaxValue);
     this.G = (byte)(colour.G * MaxValue);
     this.B = (byte)(colour.B * MaxValue);
     this.A = (byte)(colour.A * MaxValue);
 }
Exemple #2
0
        public static Color256 Combine(Color256 a, Color256 b)
        {
            double aAB = (1.0D - a.A) * b.A + a.A;

            return(new Color256(
                       ((1.0D - a.A) * b.A * b.R + a.A * a.R) / aAB,
                       ((1.0D - a.A) * b.A * b.G + a.A * a.G) / aAB,
                       ((1.0D - a.A) * b.A * b.B + a.A * a.B) / aAB,
                       aAB
                       ));
        }