Class: QgsLimitedRandomColorRamp¶
- class qgis.core.QgsLimitedRandomColorRamp¶
Bases:
QgsColorRamp
Constrained random color ramp, which returns random colors based on preset parameters.
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) 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
)Methods
- rtype:
QgsLimitedRandomColorRamp
- param value:
- rtype:
int
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
- rtype:
Dict[str, Any]
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
- rtype:
str
Returns the string identifier for QgsLimitedRandomColorRamp.
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
- param index:
- clone(self) QgsLimitedRandomColorRamp ¶
- Return type:
- color(self, value: float) QColor ¶
- Parameters:
value (float) –
- Return type:
QColor
- count(self) int ¶
- Return type:
int
- create(properties: Dict[str, Any] = {}) QgsColorRamp ¶
Returns a new
QgsLimitedRandomColorRamp
color ramp created using the properties encoded in a string map.- Parameters:
properties (Dict[str) – color ramp properties
See also
- Return type:
- hueMax(self) int ¶
Returns the maximum hue for generated colors
See also
- Return type:
int
- hueMin(self) int ¶
Returns the minimum hue for generated colors
See also
- Return type:
int
- properties(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- 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
- Parameters:
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) –
- Return type:
List[QColor]
- satMax(self) int ¶
Returns the maximum saturation for generated colors
See also
- Return type:
int
- satMin(self) int ¶
Returns the minimum saturation for generated colors
See also
- Return type:
int
- setCount(self, val: int)¶
Sets the number of colors contained in the ramp.
- Parameters:
val (int) –
- setHueMax(self, val: int)¶
Sets the maximum hue for generated colors
See also
- Parameters:
val (int) –
- setHueMin(self, val: int)¶
Sets the minimum hue for generated colors
See also
- Parameters:
val (int) –
- setSatMax(self, val: int)¶
Sets the maximum saturation for generated colors
See also
- Parameters:
val (int) –
- setSatMin(self, val: int)¶
Sets the minimum saturation for generated colors
See also
- Parameters:
val (int) –
- setValMax(self, val: int)¶
Sets the maximum value for generated colors
See also
- Parameters:
val (int) –
- setValMin(self, val: int)¶
Sets the minimum value for generated colors
See also
- Parameters:
val (int) –
- type(self) str ¶
- Return type:
str
- typeString() str ¶
Returns the string identifier for QgsLimitedRandomColorRamp.
New in version 3.16.
- Return type:
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
- Return type:
int
- valMin(self) int ¶
Returns the minimum value for generated colors
See also
- Return type:
int
- value(self, index: int) float ¶
- Parameters:
index (int) –
- Return type:
float