Class: QgsProcessingParameterColor

A color parameter for processing algorithms.

QgsProcessingParameterColor should be evaluated by calling QgsProcessingAlgorithm.parameterAsColor().

Added in version 3.10.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingParameterColor

Base classes

QgsProcessingParameterDefinition

Base class for the definition of processing parameters.

Methods

opacityEnabled

Returns True if the parameter allows opacity control.

setOpacityEnabled

Sets whether the parameter allows opacity control.

Static Methods

fromScriptCode

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

typeName

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 is True, 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:

a0 (QgsProcessingParameterColor)

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.

Return type:

bool

setOpacityEnabled(self, enabled: bool)[source]

Sets whether the parameter allows opacity control.

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

See also

opacityEnabled()

Parameters:

enabled (bool)

static typeName() str[source]

Returns the type name for the parameter class.

Return type:

str