Class: QgsProcessingParameterColor

class qgis.core.QgsProcessingParameterColor(name: str, description: str = '', defaultValue: Any = None, opacityEnabled: bool = True, optional: bool = False)

Bases: qgis._core.QgsProcessingParameterDefinition

Constructor for QgsProcessingParameterColor.

If opacityEnabled is True, then users will have the option of varying color opacity.

QgsProcessingParameterColor(QgsProcessingParameterColor)

A color parameter for processing algorithms.

QgsProcessingParameterColor should be evaluated by calling QgsProcessingAlgorithm.parameterAsColor()

New in version 3.10: Enums

Methods

asPythonString

asScriptCode

checkValueIsAcceptable

clone

fromScriptCode

Creates a new parameter using the definition from a script code.

fromVariantMap

opacityEnabled

Returns True if the parameter allows opacity control.

setOpacityEnabled

Sets whether the parameter allows opacity control.

toVariantMap

type

typeName

Returns the type name for the parameter class.

valueAsPythonString

Signals

Attributes

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) → str
asScriptCode(self) → str
checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None) → bool
clone(self) → QgsProcessingParameterDefinition
fromScriptCode(name: str, description: str, isOptional: bool, definition: str) → QgsProcessingParameterColor

Creates a new parameter using the definition from a script code.

fromVariantMap(self, map: Dict[str, Any]) → bool
opacityEnabled(self) → bool

Returns True if the parameter allows opacity control.

The default behavior is to allow users to set opacity for the color.

setOpacityEnabled(self, enabled: bool)

Sets whether the parameter allows opacity control.

The default behavior is to allow users to set opacity for the color.

See also

opacityEnabled()

toVariantMap(self) → Dict[str, Any]
type(self) → str
typeName() → str

Returns the type name for the parameter class.

valueAsPythonString(self, value: Any, context: QgsProcessingContext) → str