public static Lerp ( |
||
from | The color value that represents 0 on the lerp number line. | |
to | The color value that represents 1 on the lerp number line. | |
frac | double | A value in the range [0, 1]. |
Résultat |
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;
}
public static byte ClampToByte(double x)