diff --git a/python/damask/_colormaps.py b/python/damask/_colormaps.py index 2117b0b57..94416ffcd 100644 --- a/python/damask/_colormaps.py +++ b/python/damask/_colormaps.py @@ -450,7 +450,7 @@ class Colormap: def rad_diff(a,b): return abs(a[2]-b[2]) - + def adjust_hue(Msh_sat, Msh_unsat): """If saturation of one of the two colors is too less than the other, hue of the less.""" if Msh_sat[0] >= Msh_unsat[0]: @@ -502,7 +502,7 @@ class Colormap: [RGB] colormap for use in paraview or gmsh, or as raw string, or array. Arguments: name, format, steps, crop. - Format is one of (paraview, gmsh, raw, list). + Format is one of (paraview, gmsh, gom, raw, list). Crop selects a (sub)range in [-1.0,1.0]. Generates sequential map if one limiting color is either white or black, diverging map otherwise. @@ -511,23 +511,22 @@ class Colormap: frac = 0.5*(np.array(crop) + 1.0) # rescale crop range to fractions colors = [self.color(float(i)/(steps-1)*(frac[1]-frac[0])+frac[0]).express_as(model).color for i in range(steps)] if format == 'paraview': - colormap = ['[\n {{\n "ColorSpace": "RGB", "Name": "{}", "DefaultMap": true,\n "RGBPoints" : ['.format(name)] \ - + [' {:4d},{:8.6f},{:8.6f},{:8.6f},'.format(i,color[0],color[1],color[2],) \ - for i,color in enumerate(colors[:-1])] \ - + [' {:4d},{:8.6f},{:8.6f},{:8.6f} '.format(len(colors),colors[-1][0],colors[-1][1],colors[-1][2],)] \ + colormap = [f'[\n {{\n "ColorSpace": "RGB", "Name": "{name}", "DefaultMap": true,\n "RGBPoints" : ['] \ + + [f' {i:4d},{color[0]:8.6f},{color[1]:8.6f},{color[2]:8.6f}{"," if i+1