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 might one go about that?
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 might one go about that?
I think its easier to blend an array of colors, in case you want to blend more then 2 Here is my function:
private Color colorBlend(List<Color> clrArr)
{
int r = 0;
int g = 0;
int b = 0;
foreach(Color color in clrArr)
{
r += color.R;
g += color.G;
b += color.B;
}
r = r / clrArr.Count;
g = g / clrArr.Count;
b = b / clrArr.Count;
return Color.FromArgb(r, g, b);
}
The array must be as a List of color Use :
List<Color> colorList = new List<Color>();
colorList.Add(Color.Red);
colorList.Add(Color.Blue);
picturebox.backColor = colorBlend(colorList);