Class: QgsGradientStop

class qgis.core.QgsGradientStop

Bases: sip.wrapper

Represents a color stop within a QgsGradientColorRamp color ramp.

New in version 3.0.

QgsGradientStop(offset: float, color: Union[QColor, Qt.GlobalColor, QGradient]) Constructor for QgsGradientStop

Parameters:
  • offset – positional offset for stop, between 0 and 1.0

  • color – color for stop

QgsGradientStop(QgsGradientStop)

Methods

colorSpec

Returns the color specification in which the color component interpolation will occur.

direction

Returns the direction to traverse the color wheel using when interpolating hue-based color specifications.

setColorSpec

Sets the color specification in which the color component interpolation will occur.

setDirection

Sets the direction to traverse the color wheel using when interpolating hue-based color specifications.

Attributes

color
colorSpec(self) QColor.Spec

Returns the color specification in which the color component interpolation will occur.

For multi-stop gradients this color spec will be used for the portion of the color ramp leading into the current stop.

See also

setColorSpec()

New in version 3.24.

Return type:

QColor.Spec

direction(self) Qgis.AngularDirection

Returns the direction to traverse the color wheel using when interpolating hue-based color specifications.

For multi-stop gradients this direction will be used for the portion of the color ramp leading into the current stop.

See also

setDirection()

New in version 3.24.

Return type:

Qgis.AngularDirection

offset
setColorSpec(self, spec: QColor.Spec)

Sets the color specification in which the color component interpolation will occur.

Only QColor.Spec.Rgb, QColor.Spec.Hsv and QColor.Spec.Hsl are currently supported.

For multi-stop gradients this color spec will be used for the portion of the color ramp leading into the current stop.

See also

colorSpec()

New in version 3.24.

Parameters:

spec (QColor.Spec) –

setDirection(self, direction: Qgis.AngularDirection)

Sets the direction to traverse the color wheel using when interpolating hue-based color specifications.

For multi-stop gradients this direction will be used for the portion of the color ramp leading into the current stop.

See also

direction()

New in version 3.24.

Parameters:

direction (Qgis.AngularDirection) –