Nez.Portable/Utils/Extensions/ColorExt.cs
/// <summary>
/// linearly interpolates Color from - to
/// </summary>
/// <param name="from">From.</param>
/// <param name="to">To.</param>
/// <param name="t">T.</param>
linearly interpolates Color from - to
linearly interpolates Color from - to
public static void lerp(ref Color from, ref Color to, out Color result, float t)
        {
            result = new Color();
            var t255 = (int)(t * 255);
            result.R = (byte)(from.R + (to.R - from.R) * t255 / 255);
            result.G = (byte)(from.G + (to.G - from.G) * t255 / 255);
            result.B = (byte)(from.B + (to.B - from.B) * t255 / 255);
            result.A = (byte)(from.A + (to.A - from.A) * t255 / 255);
        }
public static void lerp ( ref Color from , ref Color to , out Color result , float t ) { result = new Color ( ) ; var t255 = ( int ) ( t * 255 ) ; result . R = ( byte ) ( from . R + ( to . R - from . R ) * t255 / 255 ) ; result . G = ( byte ) ( from . G + ( to . G - from . G ) * t255 / 255 ) ; result . B = ( byte ) ( from . B + ( to . B - from . B ) * t255 / 255 ) ; result . A = ( byte ) ( from . A + ( to . A - from . A ) * t255 / 255 ) ; }
linearly interpolates Color from - to
linearly interpolates Color from - to
Color
out
t
float
None
from
None
to
None