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
Returns the color specification in which the color component interpolation will occur.
Returns the direction to traverse the color wheel using when interpolating hue-based color specifications.
Sets the color specification in which the color component interpolation will occur.
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
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
New in version 3.24.
- Return type:
- 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
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
New in version 3.24.
- Parameters:
direction (Qgis.AngularDirection) –