Subgroup: other
Class: QgsLimitedRandomColorRamp¶
-
class
qgis.core.
QgsLimitedRandomColorRamp
¶ Bases:
qgis._core.QgsColorRamp
Constrained random color ramp, which returns random colors based on preset parameters.
New in version 3.0: Methods
clone
color
count
create
Returns a new QgsLimitedRandomColorRamp color ramp created using the properties encoded in a string map. hueMax
Returns the maximum hue for generated colors hueMin
Returns the minimum hue for generated colors invert
Inverts the ordering of the color ramp. properties
randomColors
Get a list of random colors satMax
Returns the maximum saturation for generated colors satMin
Returns the minimum saturation for generated colors setCount
Sets the number of colors contained in the ramp. setHueMax
Sets the maximum hue for generated colors setHueMin
Sets the minimum hue for generated colors setSatMax
Sets the maximum saturation for generated colors setSatMin
Sets the minimum saturation for generated colors setValMax
Sets the maximum value for generated colors setValMin
Sets the minimum value for generated colors type
updateColors
Must be called after changing the properties of the color ramp to regenerate the list of random colors. valMax
Returns the maximum value for generated colors valMin
Returns the minimum value for generated colors value
Attributes
-
clone
(self) → QgsLimitedRandomColorRamp¶
-
color
(self, value: float) → QColor¶
-
count
(self) → int¶
-
create
(properties: Dict[str, str] = {}) → QgsColorRamp¶ Returns a new QgsLimitedRandomColorRamp color ramp created using the properties encoded in a string map.
Parameters: properties – color ramp properties See also
-
hueMax
(self) → int¶ Returns the maximum hue for generated colors
See also
-
hueMin
(self) → int¶ Returns the minimum hue for generated colors
See also
-
properties
(self) → Dict[str, str]¶
-
randomColors
(count: int, hueMax: int = DEFAULT_RANDOM_HUE_MAX, hueMin: int = DEFAULT_RANDOM_HUE_MIN, satMax: int = DEFAULT_RANDOM_SAT_MAX, satMin: int = DEFAULT_RANDOM_SAT_MIN, valMax: int = DEFAULT_RANDOM_VAL_MAX, valMin: int = DEFAULT_RANDOM_VAL_MIN) → List[QColor]¶ Get a list of random colors
New in version 2.4.
-
satMax
(self) → int¶ Returns the maximum saturation for generated colors
See also
-
satMin
(self) → int¶ Returns the minimum saturation for generated colors
See also
-
setCount
(self, val: int)¶ Sets the number of colors contained in the ramp.
-
type
(self) → str¶
-
updateColors
(self)¶ Must be called after changing the properties of the color ramp to regenerate the list of random colors.
-
valMax
(self) → int¶ Returns the maximum value for generated colors
See also
-
valMin
(self) → int¶ Returns the minimum value for generated colors
See also
-
value
(self, index: int) → float¶
-