Class: QgsRandomColorRamp

Totally random color ramp. Returns colors generated at random, but constrained to some hardcoded saturation and value ranges to prevent ugly color generation.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRandomColorRamp

Base classes

QgsColorRamp

Abstract base class for color ramps

Methods

setTotalColorCount

Sets the desired total number of unique colors for the resultant ramp.

Static Methods

typeString

Returns the string identifier for QgsRandomColorRamp.

class qgis.core.QgsRandomColorRamp[source]

Bases: QgsColorRamp

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

static typeString() str[source]

Returns the string identifier for QgsRandomColorRamp.

Added in version 3.16.

Return type:

str