Subgroup: Color
Class: QgsColorBrewerColorRamp¶
-
class
qgis.core.
QgsColorBrewerColorRamp
¶ Bases:
qgis._core.QgsColorRamp
Color ramp utilising “Color Brewer” preset color schemes.
New in version 3.0: Methods
clone
color
colors
Returns the number of colors in the ramp. count
create
Returns a new QgsColorBrewerColorRamp color ramp created using the properties encoded in a string map. invert
listSchemeNames
Returns a list of all valid color brewer scheme names. listSchemeVariants
Returns a list of the valid variants (numbers of colors) for a specified loadPalette
Generates the scheme using the current name and number of colors properties
schemeName
Returns the name of the color brewer color scheme. setColors
Sets the number of colors in the ramp. setSchemeName
Sets the name of the color brewer color scheme. type
value
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¶
-