skued.spectrum_colors

skued.spectrum_colors(num_colors)

Generates a set of RGB colors corresponding to the visible spectrum (i.e. the rainbow). These colors can be used by Matplotlib, PyQtGraph, Qt, and other plotting/graphics libraries.

You can use the colors from this function as a colormap, named ‘spectrum’, provided that scikit-ued has been imported.

Parameters:

num_colors (int or iterable) – Number of colors to generate. Alternatively, if num_colors is an iterable of numbers, then the number of colors is deduced with specific spacing.

Yields:

color ((R,G,B) tuple.) – R, G, B values in a tuple, from 0.0 to 1.0.

See also

spectrum_cmap

Matplotlib colormap based on the colors from spectrum_colors.