Is there an easy way to blend two System.Drawing.Color values? Or do I have to write my own method to take in two colors and combine them?
If I do, how
I wrote a utility method for exactly this purpose. :)
/// Blends the specified colors together.
/// Color to blend onto the background color.
/// Color to blend the other color onto.
/// How much of to keep,
/// “on top of” .
/// The blended colors.
public static Color Blend(this Color color, Color backColor, double amount)
{
byte r = (byte) ((color.R * amount) + backColor.R * (1 - amount));
byte g = (byte) ((color.G * amount) + backColor.G * (1 - amount));
byte b = (byte) ((color.B * amount) + backColor.B * (1 - amount));
return Color.FromArgb(r, g, b);
}