Blend() public static méthode

Constructs a new ColorBgra instance from the values in the given Color instance. Converts this ColorBgra instance to a Color instance. Smoothly blends between two colors.
public static Blend ( ColorBgra ca, ColorBgra cb, byte cbAlpha ) : ColorBgra
ca ColorBgra
cb ColorBgra
cbAlpha byte
Résultat ColorBgra
        public virtual void BeforeRender()
        {
            if (!this.lerpCacheIsValid)
            {
                byte startAlpha;
                byte endAlpha;

                if (this.alphaOnly)
                {
                    ComputeAlphaOnlyValuesFromColors(this.startColor, this.endColor, out startAlpha, out endAlpha);
                }
                else
                {
                    startAlpha = this.startColor.A;
                    endAlpha   = this.endColor.A;
                }

                this.lerpAlphas = new byte[256];
                this.lerpColors = new ColorBgra[256];

                for (int i = 0; i < 256; ++i)
                {
                    byte a = (byte)i;
                    this.lerpColors[a] = ColorBgra.Blend(this.startColor, this.endColor, a);
                    this.lerpAlphas[a] = (byte)(startAlpha + ((endAlpha - startAlpha) * a) / 255);
                }

                this.lerpCacheIsValid = true;
            }
        }