Class: QgsPresetSchemeColorRamp

class qgis.core.QgsPresetSchemeColorRamp(colors: Iterable[Union[QColor, Qt.GlobalColor, QGradient]] = [])

Bases: qgis._core.QgsColorRamp, qgis._core.QgsColorScheme

Constructor for QgsPresetSchemeColorRamp.

Parameters:colors – list of colors in ramp

QgsPresetSchemeColorRamp(colors: object) Constructor for QgsPresetColorRamp.

Parameters:colors – list of named colors in ramp

QgsPresetSchemeColorRamp(QgsPresetSchemeColorRamp)

A scheme based color ramp consisting of a list of predefined colors.

New in version 3.0: Enums

Methods

clone
color
colors Returns the list of colors used by the ramp.
count
create Returns a new QgsPresetSchemeColorRamp color ramp created using the properties encoded in a string map.
fetchColors
invert
isEditable
properties
schemeName
setColors Sets the list of colors used by the ramp.
type
value

Signals

Attributes

clone(self) → QgsPresetSchemeColorRamp
color(self, value: float) → QColor
colors(self) → List[QColor]

Returns the list of colors used by the ramp.

See also

setColors()

count(self) → int
create(properties: Dict[str, str] = {}) → QgsColorRamp

Returns a new QgsPresetSchemeColorRamp color ramp created using the properties encoded in a string map.

Parameters:properties – color ramp properties

See also

properties()

fetchColors(self, context: str = '', baseColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) → object
invert(self)
isEditable(self) → bool
properties(self) → Dict[str, str]
schemeName(self) → str
setColors(self, colors: object, a1: str = '', a2: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) → bool

Sets the list of colors used by the ramp.

Parameters:colors – list of colors

See also

colors()

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