Bug report #21956
QgsGradientColorRamp.invert returns None
| Status: | Rejected | ||
|---|---|---|---|
| Priority: | Normal | ||
| Assignee: | - | ||
| Category: | Symbology | ||
| Affected QGIS version: | 3.6.2 | Regression?: | No |
| Operating System: | Windows 10 | Easy fix?: | No |
| Pull Request or Patch supplied: | No | Resolution: | invalid |
| Crashes QGIS or corrupts data: | No | Copied to github as #: | 29771 |
Description
QgsGradientColorRamp.invert is not returning a valid color ramp.
Tested in the QGIS Python Consol:
>>>QgsStyle().defaultStyle().colorRamp('Spectral')
<qgis._core.QgsGradientColorRamp object at 0x2D849850>
>>>QgsStyle().defaultStyle().colorRamp('Spectral').invert()
# returns None
History
#1
Updated by Nyall Dawson over 6 years ago
- Resolution set to invalid
- Status changed from Open to Rejected
QgsColorRamp.invert doesn't return a new ramp -- it inverts a ramp in place. See https://qgis.org/pyqgis/master/core/QgsColorRamp.html#qgis.core.QgsColorRamp.invert