I have an application built on Mayavi where I let the user specify a colormap for some data. Because newer versions of Matplotlib have colormaps that Mayavi lacks, I'd like to be able to either use the native Mayavi colormap or make a lookuptable based on the Matplotlib colormap, if Mayavi doesn't offer it.
I could try and use the user-supplied name and catch the TraitError that is raised, but I'd rather just check the supplied name against an existing list of colors. For example, in Matplotlib I would do
import matplotlib.pyplot as plt
def is_mpl_cmap(name):
if name in dir(plt.cm):
return True
return False
Is there a similar repository of colormap names in Mayavi that I could access?