Class: QgsProcessingParameterColor¶
A color parameter for processing algorithms.
QgsProcessingParameterColor
should be evaluated by calling
QgsProcessingAlgorithm.parameterAsColor()
.
Added in version 3.10.
Class Hierarchy¶
Base classes¶
Base class for the definition of processing parameters. |
Methods
Returns |
|
Sets whether the parameter allows opacity control. |
Static Methods
Creates a new parameter using the definition from a script code. |
|
Returns the type name for the parameter class. |
- class qgis.core.QgsProcessingParameterColor[source]¶
Bases:
QgsProcessingParameterDefinition
- __init__(name: str | None, description: str | None = '', defaultValue: Any = None, opacityEnabled: bool = True, optional: bool = False)
Constructor for QgsProcessingParameterColor.
If
opacityEnabled
isTrue
, then users will have the option of varying color opacity.- Parameters:
name (Optional[str])
description (Optional[str] = '')
defaultValue (Any = None)
opacityEnabled (bool = True)
optional (bool = False)
- __init__(a0: QgsProcessingParameterColor)
- Parameters:
- static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterColor | None [source]¶
Creates a new parameter using the definition from a script code.
- Parameters:
name (Optional[str])
description (Optional[str])
isOptional (bool)
definition (Optional[str])
- Return type:
Optional[QgsProcessingParameterColor]
- opacityEnabled(self) bool [source]¶
Returns
True
if the parameter allows opacity control.The default behavior is to allow users to set opacity for the color.
See also
- Return type:
bool