public static Blend ( |
||
ca | ||
cb | ||
cbAlpha | byte | |
return |
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; } }