ScottPlot.NET
GitHub Repo stars

Interpolating Colors

A collection of colors can be generated from the linear interpolation between two colors.

ScottPlot.Plot myPlot = new();

Color[] colors = Color.InterpolateRgbArray(Colors.Blue, Colors.Green, steps: 20);

for (int i = 0; i < colors.Length; i++)
{
    var sig = myPlot.Add.Signal(Generate.Sin());
    sig.Data.XOffset = i * 3;
    sig.Data.YOffset = i * .1;
    sig.LineWidth = 3;
    sig.LineColor = colors[i];
}

myPlot.SavePng("demo.png", 400, 300);
This recipe is one of many in the Color category