Class: QgsColorBrewerColorRamp¶
- class qgis.core.QgsColorBrewerColorRamp¶
Bases:
QgsColorRamp
Color ramp utilising “Color Brewer” preset color schemes.
New in version 3.0.
QgsColorBrewerColorRamp(schemeName: str = ‘’, colors: int = DEFAULT_COLORBREWER_COLORS, inverted: bool = False) Constructor for QgsColorBrewerColorRamp
- Parameters
schemeName – color brewer scheme name
colors – number of colors in ramp
inverted – invert ramp ordering
QgsColorBrewerColorRamp(
QgsColorBrewerColorRamp
)Methods
- rtype
QgsColorBrewerColorRamp
- param value
Returns the number of colors in the ramp.
- rtype
int
Returns a new
QgsColorBrewerColorRamp
color ramp created using the properties encoded in a string map.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
Generates the scheme using the current name and number of colors
- rtype
Dict[str, Any]
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.
- rtype
str
Returns the string identifier for QgsColorBrewerColorRamp.
- param index
- clone(self) QgsColorBrewerColorRamp ¶
- Return type
- color(self, value: float) QColor ¶
- Parameters
value (float) –
- Return type
QColor
- colors(self) int ¶
Returns the number of colors in the ramp.
See also
- Return type
int
- count(self) int ¶
- Return type
int
- create(properties: Dict[str, Any] = {}) QgsColorRamp ¶
Returns a new
QgsColorBrewerColorRamp
color ramp created using the properties encoded in a string map.- Parameters
properties (Dict[str) – color ramp properties
See also
- Return type
- invert(self)¶
- listSchemeNames() List[str] ¶
Returns a list of all valid color brewer scheme names.
See also
- Return type
List[str]
- listSchemeVariants(schemeName: str) List[int] ¶
Returns a list of the valid variants (numbers of colors) for a specified color brewer scheme name
- Parameters
schemeName (str) – color brewer scheme name
See also
- Return type
List[int]
- loadPalette(self)¶
Generates the scheme using the current name and number of colors
- properties(self) Dict[str, Any] ¶
- Return type
Dict[str, Any]
- schemeName(self) str ¶
Returns the name of the color brewer color scheme.
See also
- Return type
str
- setColors(self, colors: int)¶
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
- setSchemeName(self, schemeName: str)¶
Sets the name of the color brewer color scheme.
- Parameters
schemeName (str) – scheme name, must match a valid color brewer scheme name
See also
See also
- type(self) str ¶
- Return type
str
- typeString() str ¶
Returns the string identifier for QgsColorBrewerColorRamp.
New in version 3.16.
- Return type
str
- value(self, index: int) float ¶
- Parameters
index (int) –
- Return type
float