swharden / Spectrogram

.NET library for creating spectrograms (visual representations of frequency spectrum over time)
https://nuget.org/packages/Spectrogram
MIT License
320 stars 58 forks source link

get colormap by name #18

Closed swharden closed 4 years ago

swharden commented 4 years ago

Currently using a listbox requires this:

cbColormap.Items.AddRange(Colormap.GetColormaps().Select(x => x.Name).ToArray());
var cmap = Colormap.GetColormaps().Where(x => x.Name == cbColormap.Text).ToArray()[0];

I'd like to be able to:

cbColormap.Items.AddRange(Colormap.GetColormapNames());
var cmap = Colormap.GetColormapFromName(cbColormap.Text);