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