def getCoolToWarmColorMap(self, scalarRange): f = vtk.vtkDiscretizableColorTransferFunction() f.DiscretizeOn() f.SetColorSpaceToDiverging() f.SetNumberOfValues(256) f.AddRGBPoint(scalarRange[0], 0.23, 0.299, 0.754) f.AddRGBPoint(scalarRange[1], 0.706, 0.016, 0.15) f.Build() return f