Class: QgsRandomColorRamp¶
A color ramp consisting of random colors, constrained within component ranges.
Returns colors generated at random, but constrained to some hardcoded saturation and value ranges to prevent ugly color generation.
Class Hierarchy¶
Base classes¶
Abstract base class for color ramps. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsRandomColorRamp. See the FAQ for more details.
Sets the desired total number of unique colors for the resultant ramp. |
Static Methods
Returns the string identifier for QgsRandomColorRamp. |
- class qgis.core.QgsRandomColorRamp[source]¶
Bases:
QgsColorRamp
- virtual setTotalColorCount(self, colorCount: int)[source]¶
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