Class: QgsRandomColorRamp

class qgis.core.QgsRandomColorRamp

Bases: qgis._core.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.

New in version 3.0: Enums

Methods

clone
color
count
properties
setTotalColorCount Sets the desired total number of unique colors for the resultant ramp.
type
value

Signals

Attributes

clone(self) → QgsRandomColorRamp
color(self, value: float) → QColor
count(self) → int
properties(self) → Dict[str, str]
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 – number of unique colors

New in version 2.5.

type(self) → str
value(self, index: int) → float