Ejemplo n.º 1
0
        public static SimpleColor Blend(SimpleColor a, SimpleColor b)
        {
            int    rval, gval, bval;
            double aval;

            rval = RGBClamp((int)(a.GetA() * (a.GetR() - b.GetR()) + b.GetR()));
            gval = RGBClamp((int)(a.GetA() * (a.GetG() - b.GetG()) + b.GetG()));
            bval = RGBClamp((int)(a.GetA() * (a.GetB() - b.GetB()) + b.GetB()));
            aval = a.GetA() + b.GetA() * (1 - a.GetA());

            return(new SimpleColor(rval, gval, bval, aval));
        }