Class: QgsRandomColorRamp¶
- class qgis.core.QgsRandomColorRamp¶
Bases:
QgsColorRamp
Constructor for QgsRandomColorRamp.
QgsRandomColorRamp(
QgsRandomColorRamp
)Totally random color ramp. Returns colors generated at random, but constrained to some hardcoded saturation and value ranges to prevent ugly color generation.
Methods
- rtype
QgsRandomColorRamp
- param value
- rtype
int
- rtype
Dict[str, Any]
Sets the desired total number of unique colors for the resultant ramp.
- rtype
str
Returns the string identifier for QgsRandomColorRamp.
- param index
- clone(self) → QgsRandomColorRamp¶
- Return type
- color(self, value: float) → QColor¶
- Parameters
value (float) –
- Return type
QColor
- count(self) → int¶
- Return type
int
- properties(self) → Dict[str, Any]¶
- Return type
Dict[str, Any]
- setTotalColorCount(self, colorCount: int)¶
Sets the desired total number of unique colors for the resultant ramp. Calling this method pregenerates a set of visually distinct colors which are returned by subsequent calls to
color()
.- Parameters
colorCount (int) – number of unique colors
New in version 2.5.
- type(self) → str¶
- Return type
str
- typeString() → str¶
Returns the string identifier for QgsRandomColorRamp.
New in version 3.16.
- Return type
str
- value(self, index: int) → float¶
- Parameters
index (int) –
- Return type
float