From 3b72d0ec725450d576a6d2fa3ea310f20d471164 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 2 Jul 2020 10:13:47 -0400 Subject: [PATCH] added __invert__ method to reverse colormap --- python/damask/_colormap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index 964f22d85..2533d4d36 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -24,6 +24,10 @@ class Colormap(mpl.colors.ListedColormap): return Colormap(np.vstack((self.colors,other.colors)), f'{self.name}+{other.name}') + def __invert__(self): + """Return inverted colormap.""" + return self.reversed() + @staticmethod def from_range(low,high,name='DAMASK colormap',N=256,model='rgb'): """