i added below codes. But it generates to me 16 color. but i need 16 color between "red" and "khaki". i don't need gradient flow. My colors look like gradient flow. My colors must not closer to each other. Because i will use this codes return values in chart columns. they are too near each other.
static class Program
{
[STAThread]
static void Main()
{
Form form = new Form();
Color start = Color.Red, end = Color.Khaki;
for (int i = 0; i < 16; i++)
{
int r = Interpolate(start.R, end.R, 15, i),
g = Interpolate(start.G, end.G, 15, i),
b = Interpolate(start.B, end.B, 15, i);
Button button = new Button();
button.Dock = DockStyle.Top;
button.BackColor = Color.FromArgb(r, g, b);
form.Controls.Add(button);
button.BringToFront();
}
Application.Run(form);
}
static int Interpolate(int start, int end, int steps, int count)
{
float s = start, e = end, final = s + (((e - s) / steps) * count);
return (int)final;
}
}