Class: QgsRasterSingleColorRenderer

Raster renderer which renders all data pixels using a single color.

Added in version 3.38.

Class Hierarchy

Inheritance diagram of qgis.core.QgsRasterSingleColorRenderer

Base classes

QgsRasterRenderer

Raster renderer pipe that applies colors to a raster.

QgsRasterInterface

Base class for processing filters like renderers, reprojector, resampler etc.

class qgis.core.QgsRasterSingleColorRenderer[source]

Bases: QgsRasterRenderer

__init__(input: QgsRasterInterface | None, band: int, color: QColor | Qt.GlobalColor)

Creates a single color renderer

Parameters:
color(self) QColor[source]

Returns the single color used by the renderer.

See also

setColor()

Return type:

QColor

static create(elem: QDomElement, input: QgsRasterInterface | None) QgsRasterRenderer | None[source]

Creates an instance of the renderer based on definition from XML (used by the renderer registry)

Parameters:
Return type:

Optional[QgsRasterRenderer]

setColor(self, color: QColor | Qt.GlobalColor)[source]

Sets the single color used by the renderer.

See also

color()

Parameters:

color (Union[QColor, Qt.GlobalColor])