Subgroup: other

Class: QgsPresetSchemeColorRamp

class qgis.core.QgsPresetSchemeColorRamp

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

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

New in version 3.0: 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
flags Returns the current flags for the color scheme.
invert
isEditable
properties
schemeName
setColors Sets the list of colors used by the ramp.
type
value

Attributes

ShowInAllContexts
ShowInColorButtonMenu
ShowInColorDialog
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