Class: QgsGradientStop

class qgis.core.QgsGradientStop

Bases: sip.wrapper

Represents a color stop within a QgsGradientColorRamp color ramp.

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

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

  • color – color for stop

QgsGradientStop(a0: 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.

Signals

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()

Added 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()

Added 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()

Added 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()

Added in version 3.24.

Parameters:

direction (Qgis.AngularDirection)