fixed powerbar colours,darkening, position. Moved lerping into Graphics.Util

This commit is contained in:
Alli
2010-01-04 00:43:01 +13:00
parent 4bb22a8de3
commit 4410274e36
3 changed files with 30 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Drawing;
namespace OpenRa.Game.Graphics
{
@@ -111,5 +112,19 @@ namespace OpenRa.Game.Graphics
bitmap.UnlockBits(bits);
}
}
public static Color Lerp(float t, Color a, Color b)
{
return Color.FromArgb(
LerpChannel(t, a.A, b.A),
LerpChannel(t, a.R, b.R),
LerpChannel(t, a.G, b.G),
LerpChannel(t, a.B, b.B));
}
public static int LerpChannel(float t, int a, int b)
{
return (int)((1 - t) * a + t * b);
}
}
}