-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Description
There should be a way to create a colormap starting from a collection of colors. I don't recall whether this is already possible.
Related, Color.InterpolateRgbArray:
ScottPlot/src/ScottPlot5/ScottPlot5/Primitives/Color.cs
Lines 387 to 396 in 743c942
| static public Color[] InterpolateRgbArray(Color c1, Color c2, int steps) | |
| { | |
| var stepFactor = 1.0 / (steps - 1); | |
| var array = new Color[steps]; | |
| for (var i = 0; i < steps; ++i) | |
| { | |
| array[i] = InterpolateRgb(c1, c2, stepFactor * i); | |
| } | |
| return array; | |
| } |
Note that similar functionality exists in Python
- https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.ListedColormap.html#matplotlib.colors.ListedColormap
- https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.LinearSegmentedColormap.html#matplotlib.colors.LinearSegmentedColormap
Reactions are currently unavailable