Class: QgsLimitedRandomColorRamp¶
-
class
qgis.core.
QgsLimitedRandomColorRamp
(count: int = DEFAULT_RANDOM_COUNT, hueMin: int = DEFAULT_RANDOM_HUE_MIN, hueMax: int = DEFAULT_RANDOM_HUE_MAX, satMin: int = DEFAULT_RANDOM_SAT_MIN, satMax: int = DEFAULT_RANDOM_SAT_MAX, valMin: int = DEFAULT_RANDOM_VAL_MIN, valMax: int = DEFAULT_RANDOM_VAL_MAX)¶ Bases:
qgis._core.QgsColorRamp
Constructor for QgsLimitedRandomColorRamp
- Parameters
count – number of colors in ramp
hueMin – minimum hue
hueMax – maximum hue
satMin – minimum saturation
satMax – maximum saturation
valMin – minimum color value
valMax – maximum color value
QgsLimitedRandomColorRamp(QgsLimitedRandomColorRamp)
Constrained random color ramp, which returns random colors based on preset parameters.
New in version 3.0: Enums
Methods
Returns a new QgsLimitedRandomColorRamp color ramp created using the properties encoded in a string map.
Returns the maximum hue for generated colors
Returns the minimum hue for generated colors
Gets a list of random colors
Returns the maximum saturation for generated colors
Returns the minimum saturation for generated colors
Sets the number of colors contained in the ramp.
Sets the maximum hue for generated colors
Sets the minimum hue for generated colors
Sets the maximum saturation for generated colors
Sets the minimum saturation for generated colors
Sets the maximum value for generated colors
Sets the minimum value for generated colors
Must be called after changing the properties of the color ramp to regenerate the list of random colors.
Returns the maximum value for generated colors
Returns the minimum value for generated colors
Signals
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]¶ Gets 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¶