The C# version of "Curtis White"'s answer:
public Color HeatMap(decimal value, decimal min, decimal max)
{
decimal val = (value - min) / (max - min);
int A, B, R, G;
A = 255;
R = Convert.ToByte(255 * val);
B = Convert.ToByte(255 * (1 - val));
G = 0;
return Color.FromArgb(A, R, G, B);
}