Class: QgsPresetSchemeColorRamp¶
- class qgis.core.QgsPresetSchemeColorRamp(colors: Iterable[Union[QColor, Qt.GlobalColor, QGradient]] = [])¶
Bases:
QgsColorRamp
,QgsColorScheme
Constructor for QgsPresetSchemeColorRamp.
- Parameters
colors – list of colors in ramp
QgsPresetSchemeColorRamp(colors: Iterable[Tuple[Union[QColor, Qt.GlobalColor, QGradient], str]]) 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.
Methods
- rtype
QgsPresetSchemeColorRamp
- param value
Returns the list of colors used by the ramp.
- rtype
int
Returns a new
QgsPresetSchemeColorRamp
color ramp created using the properties encoded in a string map.- param context
- rtype
bool
- rtype
Dict[str, Any]
- rtype
str
Sets the list of colors used by the ramp.
- rtype
str
Returns the string identifier for QgsPresetSchemeColorRamp.
- param index
- clone(self) → QgsPresetSchemeColorRamp¶
- Return type
- color(self, value: float) → QColor¶
- Parameters
value (float) –
- Return type
QColor
- colors(self) → List[QColor]¶
Returns the list of colors used by the ramp.
See also
- Return type
List[QColor]
- count(self) → int¶
- Return type
int
- create(properties: Dict[str, Any] = {}) → QgsColorRamp¶
Returns a new
QgsPresetSchemeColorRamp
color ramp created using the properties encoded in a string map.- Parameters
properties (Dict[str) – color ramp properties
See also
- Return type
- fetchColors(self, context: str = '', baseColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) → List[Tuple[QColor, str]]¶
- Parameters
context (str = '') –
baseColor (Union[QColor) –
- Return type
List[Tuple[QColor, str]]
- invert(self)¶
- isEditable(self) → bool¶
- Return type
bool
- properties(self) → Dict[str, Any]¶
- Return type
Dict[str, Any]
- schemeName(self) → str¶
- Return type
str
- setColors(self, colors: Iterable[Tuple[Union[QColor, Qt.GlobalColor, QGradient], str]], a1: str = '', a2: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) → bool¶
Sets the list of colors used by the ramp.
- Parameters
colors (Iterable[Tuple[Union[QColor) – list of colors
See also
- Parameters
a1 (str = '') –
a2 (Union[QColor) –
- Return type
bool
- type(self) → str¶
- Return type
str
- typeString() → str¶
Returns the string identifier for QgsPresetSchemeColorRamp.
New in version 3.16.
- Return type
str
- value(self, index: int) → float¶
- Parameters
index (int) –
- Return type
float