Example #1
0
 /// <summary>
 /// Linear interpolation between two colors
 /// </summary>
 /// <param name="a">First Color</param>
 /// <param name="b">Second Color</param>
 /// <param name="progress">Interpolation progress</param>
 /// <returns></returns>
 public static BetterColor Lerp(BetterColor a, BetterColor b, float progress)
 {
     return(new BetterColor(
                (int)(a.r + (b.r - a.r) * progress),
                (int)(a.g + (b.g - a.g) * progress),
                (int)(a.b + (b.b - a.b) * progress)
                ));
 }
Example #2
0
 /// <summary>
 /// Linear interpolation between two colors
 /// </summary>
 /// <param name="b">Second Color</param>
 /// <param name="progress">Interpolation progress</param>
 /// <returns></returns>
 public BetterColor Lerp(BetterColor b, float progress)
 {
     return(Lerp(this, b, progress));
 }