Class: QgsColorBrewerColorRamp¶
Color ramp utilising “Color Brewer” preset color schemes.
Class Hierarchy¶
Base classes¶
Abstract base class for color ramps. |
Methods
Returns the number of colors in the ramp. |
|
Generates the scheme using the current name and number of colors |
|
Returns the name of the color brewer color scheme. |
|
Sets the number of colors in the ramp. |
|
Sets the name of the color brewer color scheme. |
Static Methods
Returns a new |
|
Returns a list of all valid color brewer scheme names. |
|
Returns a list of the valid variants (numbers of colors) for a specified color brewer scheme name |
|
Returns the string identifier for QgsColorBrewerColorRamp. |
- class qgis.core.QgsColorBrewerColorRamp[source]¶
Bases:
QgsColorRamp
- __init__(schemeName: str | None = '', colors: int = DEFAULT_COLORBREWER_COLORS, inverted: bool = False)
Constructor for QgsColorBrewerColorRamp
- Parameters:
schemeName (Optional[str] = '') – color brewer scheme name
colors (int = DEFAULT_COLORBREWER_COLORS) – number of colors in ramp
inverted (bool = False) – invert ramp ordering
- __init__(a0: QgsColorBrewerColorRamp)
- Parameters:
- static create(properties: Dict[str, Any] = {}) QgsColorRamp | None [source]¶
Returns a new
QgsColorBrewerColorRamp
color ramp created using the properties encoded in a string map.- Parameters:
properties (Dict[str, Any] = {}) – color ramp properties
See also
properties()
- Return type:
Optional[QgsColorRamp]
- static listSchemeNames() List[str] [source]¶
Returns a list of all valid color brewer scheme names.
See also
- Return type:
List[str]
- static listSchemeVariants(schemeName: str | None) List[int] ¶
Returns a list of the valid variants (numbers of colors) for a specified color brewer scheme name
- Parameters:
schemeName (Optional[str]) – color brewer scheme name
See also
- Return type:
List[int]
- schemeName(self) str [source]¶
Returns the name of the color brewer color scheme.
See also
- Return type:
str
- setColors(self, colors: int)[source]¶
Sets the number of colors in the ramp.
- Parameters:
colors (int) – number of colors. Must match a valid value for the scheme, which can be retrieved using
listSchemeVariants()
See also