QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
Public Member Functions | Public Attributes | Friends | List of all members
QgsGradientStop Class Reference

Represents a color stop within a QgsGradientColorRamp color ramp. More...

#include <qgscolorrampimpl.h>

Public Member Functions

 QgsGradientStop (double offset, const QColor &color)
 Constructor for QgsGradientStop. More...
 
QColor::Spec colorSpec () const
 Returns the color specification in which the color component interpolation will occur. More...
 
Qgis::AngularDirection direction () const
 Returns the direction to traverse the color wheel using when interpolating hue-based color specifications. More...
 
bool operator!= (const QgsGradientStop &other) const
 
bool operator== (const QgsGradientStop &other) const
 
void setColorSpec (QColor::Spec spec)
 Sets the color specification in which the color component interpolation will occur. More...
 
void setDirection (Qgis::AngularDirection direction)
 Sets the direction to traverse the color wheel using when interpolating hue-based color specifications. More...
 

Public Attributes

QColor color
 Gradient color at stop. More...
 
double offset
 Relative positional offset, between 0 and 1. More...
 

Friends

class QgsGradientColorRamp
 

Detailed Description

Represents a color stop within a QgsGradientColorRamp color ramp.

Since
QGIS 3.0

Definition at line 38 of file qgscolorrampimpl.h.

Constructor & Destructor Documentation

◆ QgsGradientStop()

QgsGradientStop::QgsGradientStop ( double  offset,
const QColor &  color 
)

Constructor for QgsGradientStop.

Parameters
offsetpositional offset for stop, between 0 and 1.0
colorcolor for stop

Definition at line 175 of file qgscolorrampimpl.cpp.

Member Function Documentation

◆ colorSpec()

QColor::Spec QgsGradientStop::colorSpec ( ) const
inline

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()
Since
QGIS 3.24

Definition at line 73 of file qgscolorrampimpl.h.

◆ direction()

Qgis::AngularDirection QgsGradientStop::direction ( ) const
inline

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()
Since
QGIS 3.24

Definition at line 98 of file qgscolorrampimpl.h.

◆ operator!=()

bool QgsGradientStop::operator!= ( const QgsGradientStop other) const
inline

Definition at line 59 of file qgscolorrampimpl.h.

◆ operator==()

bool QgsGradientStop::operator== ( const QgsGradientStop other) const
inline

Definition at line 54 of file qgscolorrampimpl.h.

◆ setColorSpec()

void QgsGradientStop::setColorSpec ( QColor::Spec  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()
Since
QGIS 3.24

Definition at line 183 of file qgscolorrampimpl.cpp.

◆ setDirection()

void QgsGradientStop::setDirection ( Qgis::AngularDirection  direction)
inline

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()
Since
QGIS 3.24

Definition at line 110 of file qgscolorrampimpl.h.

Friends And Related Function Documentation

◆ QgsGradientColorRamp

friend class QgsGradientColorRamp
friend

Definition at line 118 of file qgscolorrampimpl.h.

Member Data Documentation

◆ color

QColor QgsGradientStop::color

Gradient color at stop.

Definition at line 52 of file qgscolorrampimpl.h.

◆ offset

double QgsGradientStop::offset

Relative positional offset, between 0 and 1.

Definition at line 50 of file qgscolorrampimpl.h.


The documentation for this class was generated from the following files: