added setPredefinedGradient function to ImageView, and added documentation to GradientEditorItem.loadPreset
This commit is contained in:
parent
229fc6aec9
commit
74fad9e29a
@ -473,7 +473,8 @@ class GradientEditorItem(TickSliderItem):
|
||||
|
||||
def loadPreset(self, name):
|
||||
"""
|
||||
Load a predefined gradient.
|
||||
Load a predefined gradient. Currently defined gradients are: 'thermal',
|
||||
'flame', 'yellowy', 'bipolar', 'spectrum', 'cyclic', 'greyclip', and 'grey'.
|
||||
|
||||
""" ## TODO: provide image with names of defined gradients
|
||||
#global Gradients
|
||||
|
@ -722,3 +722,9 @@ class ImageView(QtGui.QWidget):
|
||||
"""Set the color map. *colormap* is an instance of ColorMap()"""
|
||||
self.ui.histogram.gradient.setColorMap(colormap)
|
||||
|
||||
def setPredefinedGradient(self, name):
|
||||
"""Set one of the gradients defined in :class:`GradientEditorItem <pyqtgraph.graphicsItems.GradientEditorItem>`
|
||||
Currently defined gradients are: 'thermal', 'flame', 'yellowy', 'bipolar',
|
||||
'spectrum', 'cyclic', 'greyclip', and 'grey'.
|
||||
"""
|
||||
self.ui.histogram.gradient.loadPreset(name)
|
||||
|
Loading…
Reference in New Issue
Block a user