simplified code, added functionality to export raw list
This commit is contained in:
parent
c6a79d2b3d
commit
b018934b45
|
@ -63,7 +63,6 @@ class Color():
|
||||||
return self
|
return self
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
def asModel(self,toModel = 'RGB'):
|
def asModel(self,toModel = 'RGB'):
|
||||||
print self.__class__(self.model,self.color)
|
|
||||||
return self.__class__(self.model,self.color).to(toModel)
|
return self.__class__(self.model,self.color).to(toModel)
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# convert H(ue) S(aturation) L(uminance) to R(red) G(reen) B(lue)
|
# convert H(ue) S(aturation) L(uminance) to R(red) G(reen) B(lue)
|
||||||
|
@ -375,12 +374,9 @@ class Colormap():
|
||||||
RGB_Matrix.append(color.color)
|
RGB_Matrix.append(color.color)
|
||||||
RGB_Matrix_cropped = croppedVector(RGB_Matrix)
|
RGB_Matrix_cropped = croppedVector(RGB_Matrix)
|
||||||
|
|
||||||
if format.lower() == 'paraview':
|
return {\
|
||||||
colormap = write_paraview(RGB_Matrix_cropped)
|
'paraview': write_paraview,
|
||||||
if format.lower() == 'gmsh':
|
'gmsh': write_gmsh,
|
||||||
colormap = write_gmsh(RGB_Matrix_cropped)
|
'raw': write_raw,
|
||||||
if format.lower() == 'raw':
|
'list': lambda x: x,
|
||||||
colormap = write_raw(RGB_Matrix_cropped)
|
}[format.lower()](RGB_Matrix_cropped)
|
||||||
colormapStr = str(colormap)
|
|
||||||
|
|
||||||
return colormapStr
|
|
||||||
|
|
Loading…
Reference in New Issue