Subgroup: other

Class: QgsRandomColorRamp

class qgis.core.QgsRandomColorRamp

Bases: qgis._core.QgsColorRamp

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: Methods

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

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