diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index d975aecd4..3759ebe86 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -42,6 +42,11 @@ class Colormap(mpl.colors.ListedColormap): """ + def __eq__(self, other) -> bool: + """Test equality of colormaps.""" + return len(self.colors) == len(other.colors) \ + and bool(np.all(self.colors == other.colors)) + def __add__(self, other: "Colormap") -> "Colormap": """Concatenate.""" return Colormap(np.vstack((self.colors,other.colors)),