Class: QgsColorRamp¶
-
class
qgis.core.
QgsColorRamp
¶ Bases:
sip.wrapper
Abstract base class for color ramps
Methods
Creates a clone of the color ramp.
Returns the color corresponding to a specified value.
Returns number of defined colors, or -1 if undefined
Inverts the ordering of the color ramp.
Returns a string map containing all the color ramp’s properties.
Returns a string representing the color ramp type.
Returns relative value between [0,1] of color at specified index
-
clone
(self) → QgsColorRamp¶ Creates a clone of the color ramp.
- Return type
-
color
(self, value: float) → QColor¶ Returns the color corresponding to a specified value.
- Parameters
value (float) – value between [0, 1] inclusive
- Return type
QColor
- Returns
color for value
-
count
(self) → int¶ Returns number of defined colors, or -1 if undefined
- Return type
int
-
invert
(self)¶ Inverts the ordering of the color ramp.
-
properties
(self) → Dict[str, str]¶ Returns a string map containing all the color ramp’s properties.
- Return type
Dict[str, str]
-
type
(self) → str¶ Returns a string representing the color ramp type.
- Return type
str
-
value
(self, index: int) → float¶ Returns relative value between [0,1] of color at specified index
- Parameters
index (int) –
- Return type
float
-