QGIS API Documentation
3.18.1-Zürich (202f1bf7e5)
|
#include <qgscolorramp.h>
Public Member Functions | |
QgsCptCityColorRamp (const QString &schemeName, const QStringList &variantList, const QString &variantName=QString(), bool inverted=false, bool doLoadFile=true) | |
Constructor for QgsCptCityColorRamp. More... | |
QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, bool inverted=false, bool doLoadFile=true) | |
Constructor for QgsCptCityColorRamp. More... | |
QgsCptCityColorRamp * | clone () const override |
Creates a clone of the color ramp. More... | |
QgsGradientColorRamp * | cloneGradientRamp () const |
void | copy (const QgsCptCityColorRamp *other) |
QString | copyingFileName () const |
QgsStringMap | copyingInfo () const |
QString | descFileName () const |
bool | fileLoaded () const |
QString | fileName () const |
bool | hasMultiStops () const |
void | invert () override |
Inverts the ordering of the color ramp. More... | |
bool | loadFile () |
void | loadPalette () |
QVariantMap | properties () const override |
Returns a string map containing all the color ramp's properties. More... | |
QString | schemeName () const |
void | setName (const QString &schemeName, const QString &variantName=QString(), const QStringList &variantList=QStringList()) |
void | setSchemeName (const QString &schemeName) |
void | setVariantList (const QStringList &variantList) |
void | setVariantName (const QString &variantName) |
QString | type () const override |
Returns a string representing the color ramp type. More... | |
QStringList | variantList () const |
QString | variantName () const |
Public Member Functions inherited from QgsGradientColorRamp | |
QgsGradientColorRamp (const QColor &color1=DEFAULT_GRADIENT_COLOR1, const QColor &color2=DEFAULT_GRADIENT_COLOR2, bool discrete=false, const QgsGradientStopsList &stops=QgsGradientStopsList()) | |
Constructor for QgsGradientColorRamp. More... | |
void | addStopsToGradient (QGradient *gradient, double opacity=1) |
Copy color ramp stops to a QGradient. More... | |
QColor | color (double value) const override |
Returns the color corresponding to a specified value. More... | |
QColor | color1 () const |
Returns the gradient start color. More... | |
QColor | color2 () const |
Returns the gradient end color. More... | |
void | convertToDiscrete (bool discrete) |
Converts a gradient with existing color stops to or from discrete interpolation. More... | |
int | count () const override |
Returns number of defined colors, or -1 if undefined. More... | |
QgsStringMap | info () const |
Returns any additional info attached to the gradient ramp (e.g., authorship notes) More... | |
bool | isDiscrete () const |
Returns true if the gradient is using discrete interpolation, rather than smoothly interpolating between colors. More... | |
void | setColor1 (const QColor &color) |
Sets the gradient start color. More... | |
void | setColor2 (const QColor &color) |
Sets the gradient end color. More... | |
void | setDiscrete (bool discrete) |
Sets whether the gradient should use discrete interpolation, rather than smoothly interpolating between colors. More... | |
void | setInfo (const QgsStringMap &info) |
Sets additional info to attach to the gradient ramp (e.g., authorship notes) More... | |
void | setStops (const QgsGradientStopsList &stops) |
Sets the list of intermediate gradient stops for the ramp. More... | |
QgsGradientStopsList | stops () const |
Returns the list of intermediate gradient stops for the ramp. More... | |
double | value (int index) const override |
Returns relative value between [0,1] of color at specified index. More... | |
Public Member Functions inherited from QgsColorRamp | |
virtual | ~QgsColorRamp ()=default |
Static Public Member Functions | |
static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
Creates the symbol layer. More... | |
static QString | typeString () |
Returns the string identifier for QgsCptCityColorRamp. More... | |
Static Public Member Functions inherited from QgsGradientColorRamp | |
static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
Creates a new QgsColorRamp from a map of properties. More... | |
static QString | typeString () |
Returns the string identifier for QgsGradientColorRamp. More... | |
Static Public Member Functions inherited from QgsColorRamp | |
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... | |
Protected Attributes | |
bool | mFileLoaded = false |
bool | mInverted |
bool | mMultiStops = false |
QString | mSchemeName |
QStringList | mVariantList |
QString | mVariantName |
Protected Attributes inherited from QgsGradientColorRamp | |
QColor | mColor1 |
QColor | mColor2 |
bool | mDiscrete |
QgsStringMap | mInfo |
QgsGradientStopsList | mStops |
Definition at line 676 of file qgscolorramp.h.
QgsCptCityColorRamp::QgsCptCityColorRamp | ( | const QString & | schemeName = DEFAULT_CPTCITY_SCHEMENAME , |
const QString & | variantName = DEFAULT_CPTCITY_VARIANTNAME , |
||
bool | inverted = false , |
||
bool | doLoadFile = true |
||
) |
Constructor for QgsCptCityColorRamp.
schemeName | cpt-city scheme name |
variantName | cpt-city variant name |
inverted | invert ramp ordering |
doLoadFile | load cpt-city ramp from file |
Definition at line 602 of file qgscolorramp.cpp.
QgsCptCityColorRamp::QgsCptCityColorRamp | ( | const QString & | schemeName, |
const QStringList & | variantList, | ||
const QString & | variantName = QString() , |
||
bool | inverted = false , |
||
bool | doLoadFile = true |
||
) |
Constructor for QgsCptCityColorRamp.
schemeName | cpt-city scheme name |
variantList | cpt-city variant list |
variantName | cpt-city variant name |
inverted | invert ramp ordering |
doLoadFile | load cpt-city ramp from file |
Definition at line 615 of file qgscolorramp.cpp.
|
overridevirtual |
Creates a clone of the color ramp.
Reimplemented from QgsGradientColorRamp.
Definition at line 658 of file qgscolorramp.cpp.
QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp | ( | ) | const |
Definition at line 680 of file qgscolorramp.cpp.
void QgsCptCityColorRamp::copy | ( | const QgsCptCityColorRamp * | other | ) |
Definition at line 665 of file qgscolorramp.cpp.
QString QgsCptCityColorRamp::copyingFileName | ( | ) | const |
Definition at line 717 of file qgscolorramp.cpp.
QgsStringMap QgsCptCityColorRamp::copyingInfo | ( | ) | const |
Definition at line 729 of file qgscolorramp.cpp.
|
static |
Creates the symbol layer.
Definition at line 631 of file qgscolorramp.cpp.
QString QgsCptCityColorRamp::descFileName | ( | ) | const |
Definition at line 723 of file qgscolorramp.cpp.
|
inline |
Definition at line 740 of file qgscolorramp.h.
QString QgsCptCityColorRamp::fileName | ( | ) | const |
Definition at line 707 of file qgscolorramp.cpp.
|
inline |
Definition at line 736 of file qgscolorramp.h.
|
overridevirtual |
Inverts the ordering of the color ramp.
Reimplemented from QgsGradientColorRamp.
Definition at line 652 of file qgscolorramp.cpp.
bool QgsCptCityColorRamp::loadFile | ( | ) |
Definition at line 734 of file qgscolorramp.cpp.
|
inline |
Definition at line 735 of file qgscolorramp.h.
|
overridevirtual |
Returns a string map containing all the color ramp's properties.
Reimplemented from QgsGradientColorRamp.
Definition at line 696 of file qgscolorramp.cpp.
|
inline |
Definition at line 724 of file qgscolorramp.h.
|
inline |
Definition at line 732 of file qgscolorramp.h.
|
inline |
Definition at line 729 of file qgscolorramp.h.
|
inline |
Definition at line 731 of file qgscolorramp.h.
|
inline |
Definition at line 730 of file qgscolorramp.h.
|
overridevirtual |
Returns a string representing the color ramp type.
Reimplemented from QgsGradientColorRamp.
Definition at line 647 of file qgscolorramp.cpp.
|
inlinestatic |
Returns the string identifier for QgsCptCityColorRamp.
Definition at line 712 of file qgscolorramp.h.
|
inline |
Definition at line 726 of file qgscolorramp.h.
|
inline |
Definition at line 725 of file qgscolorramp.h.
|
protected |
Definition at line 750 of file qgscolorramp.h.
|
protected |
Definition at line 752 of file qgscolorramp.h.
|
protected |
Definition at line 751 of file qgscolorramp.h.
|
protected |
Definition at line 747 of file qgscolorramp.h.
|
protected |
Definition at line 749 of file qgscolorramp.h.
|
protected |
Definition at line 748 of file qgscolorramp.h.