Pinta.Core.ColorBgra.Lerp C# (CSharp) Method

Lerp() public static method

Linearly interpolates between two color values.
This method does a simple lerp on each color value and on the alpha channel. It does not properly take into account the alpha channel's effect on color blending.
public static Lerp ( ColorBgra from, ColorBgra to, double frac ) : ColorBgra
from ColorBgra The color value that represents 0 on the lerp number line.
to ColorBgra The color value that represents 1 on the lerp number line.
frac double A value in the range [0, 1].
return ColorBgra
        public static ColorBgra Lerp(ColorBgra from, ColorBgra to, double frac)
        {
            ColorBgra ret = new ColorBgra();

            ret.B = (byte)ClampToByte(Lerp(from.B, to.B, frac));
            ret.G = (byte)ClampToByte(Lerp(from.G, to.G, frac));
            ret.R = (byte)ClampToByte(Lerp(from.R, to.R, frac));
            ret.A = (byte)ClampToByte(Lerp(from.A, to.A, frac));

            return ret;
        }

Same methods

ColorBgra::Lerp ( ColorBgra from, ColorBgra to, float frac ) : ColorBgra
ColorBgra::Lerp ( double from, double to, double frac ) : double
ColorBgra::Lerp ( float from, float to, float frac ) : float