QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
|
Abstract base class for color ramps. More...
#include <qgscolorramp.h>
Public Member Functions | |
virtual | ~QgsColorRamp () |
virtual QgsColorRamp * | clone () const =0 |
Creates a clone of the color ramp. More... | |
virtual QColor | color (double value) const =0 |
Returns the color corresponding to a specified value. More... | |
virtual int | count () const =0 |
Returns number of defined colors, or -1 if undefined. More... | |
virtual void | invert () |
Inverts the ordering of the color ramp. More... | |
virtual QVariantMap | properties () const =0 |
Returns a string map containing all the color ramp's properties. More... | |
virtual QString | type () const =0 |
Returns a string representing the color ramp type. More... | |
virtual double | value (int index) const =0 |
Returns relative value between [0,1] of color at specified index. More... | |
Static Public Member Functions | |
static QList< QPair< QString, QString > > | rampTypes () |
Returns a list of available ramp types, where the first value in each item is the QgsColorRamp::type() string and the second is a user friendly, translated name for the color ramp type. More... | |
|
virtualdefault |
|
pure virtual |
Creates a clone of the color ramp.
Implemented in QgsGradientColorRamp, QgsLimitedRandomColorRamp, QgsRandomColorRamp, QgsPresetSchemeColorRamp, QgsColorBrewerColorRamp, and QgsCptCityColorRamp.
|
pure virtual |
Returns the color corresponding to a specified value.
value | value between [0, 1] inclusive |
Implemented in QgsGradientColorRamp, QgsLimitedRandomColorRamp, QgsRandomColorRamp, QgsPresetSchemeColorRamp, and QgsColorBrewerColorRamp.
|
pure virtual |
Returns number of defined colors, or -1 if undefined.
Implemented in QgsGradientColorRamp, QgsLimitedRandomColorRamp, QgsRandomColorRamp, QgsPresetSchemeColorRamp, and QgsColorBrewerColorRamp.
|
inlinevirtual |
Inverts the ordering of the color ramp.
Reimplemented in QgsGradientColorRamp, QgsPresetSchemeColorRamp, QgsColorBrewerColorRamp, and QgsCptCityColorRamp.
Definition at line 80 of file qgscolorramp.h.
|
pure virtual |
Returns a string map containing all the color ramp's properties.
Implemented in QgsGradientColorRamp, QgsLimitedRandomColorRamp, QgsRandomColorRamp, QgsPresetSchemeColorRamp, QgsColorBrewerColorRamp, and QgsCptCityColorRamp.
|
static |
Returns a list of available ramp types, where the first value in each item is the QgsColorRamp::type() string and the second is a user friendly, translated name for the color ramp type.
The ramp types are returned in a order of precedence for exposing in UI, with more commonly used types listed first.
Definition at line 21 of file qgscolorramp.cpp.
|
pure virtual |
Returns a string representing the color ramp type.
Implemented in QgsGradientColorRamp, QgsLimitedRandomColorRamp, QgsRandomColorRamp, QgsPresetSchemeColorRamp, QgsColorBrewerColorRamp, and QgsCptCityColorRamp.
|
pure virtual |
Returns relative value between [0,1] of color at specified index.
Implemented in QgsGradientColorRamp, QgsLimitedRandomColorRamp, QgsRandomColorRamp, QgsPresetSchemeColorRamp, and QgsColorBrewerColorRamp.