Color ramp utilising "Color Brewer" preset color schemes.
More...
#include <qgscolorrampimpl.h>
|
| | QgsColorBrewerColorRamp (const QString &schemeName=DEFAULT_COLORBREWER_SCHEMENAME, int colors=DEFAULT_COLORBREWER_COLORS, bool inverted=false) |
| | Constructor for QgsColorBrewerColorRamp.
|
| QgsColorBrewerColorRamp * | clone () const override |
| | Creates a clone of the color ramp.
|
| QColor | color (double value) const override |
| | Returns the color corresponding to a specified value.
|
| int | colors () const |
| | Returns the number of colors in the ramp.
|
| int | count () const override |
| | Returns number of defined colors, or -1 if undefined.
|
| void | invert () override |
| | Inverts the ordering of the color ramp.
|
| QVariantMap | properties () const override |
| | Returns a string map containing all the color ramp's properties.
|
| QString | schemeName () const |
| | Returns the name of the color brewer color scheme.
|
| void | setColors (int colors) |
| | Sets the number of colors in the ramp.
|
| void | setSchemeName (const QString &schemeName) |
| | Sets the name of the color brewer color scheme.
|
| QString | type () const override |
| | Returns a string representing the color ramp type.
|
| double | value (int index) const override |
| | Returns relative value between [0,1] of color at specified index.
|
| virtual | ~QgsColorRamp () |
|
| static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
| | Returns a new QgsColorBrewerColorRamp color ramp created using the properties encoded in a string map.
|
| static QStringList | listSchemeNames () |
| | Returns a list of all valid color brewer scheme names.
|
| static QList< int > | listSchemeVariants (const QString &schemeName) |
| | Returns a list of the valid variants (numbers of colors) for a specified color brewer scheme name.
|
| static QString | typeString () |
| | Returns the string identifier for QgsColorBrewerColorRamp.
|
| 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.
|
|
| void | loadPalette () |
| | Generates the scheme using the current name and number of colors.
|
Color ramp utilising "Color Brewer" preset color schemes.
Definition at line 605 of file qgscolorrampimpl.h.
◆ QgsColorBrewerColorRamp()
◆ clone()
◆ color()
| QColor QgsColorBrewerColorRamp::color |
( |
double | value | ) |
const |
|
overridevirtual |
Returns the color corresponding to a specified value.
- Parameters
-
| value | value between [0, 1] inclusive |
- Returns
- color for value
Implements QgsColorRamp.
Definition at line 916 of file qgscolorrampimpl.cpp.
◆ colors()
| int QgsColorBrewerColorRamp::colors |
( |
| ) |
const |
|
inline |
◆ count()
| int QgsColorBrewerColorRamp::count |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ create()
| QgsColorRamp * QgsColorBrewerColorRamp::create |
( |
const QVariantMap & | properties = QVariantMap() | ) |
|
|
static |
◆ invert()
| void QgsColorBrewerColorRamp::invert |
( |
| ) |
|
|
overridevirtual |
◆ listSchemeNames()
| QStringList QgsColorBrewerColorRamp::listSchemeNames |
( |
| ) |
|
|
static |
◆ listSchemeVariants()
| QList< int > QgsColorBrewerColorRamp::listSchemeVariants |
( |
const QString & | schemeName | ) |
|
|
static |
Returns a list of the valid variants (numbers of colors) for a specified color brewer scheme name.
- Parameters
-
| schemeName | color brewer scheme name |
- See also
- listSchemeNames()
Definition at line 904 of file qgscolorrampimpl.cpp.
◆ loadPalette()
| void QgsColorBrewerColorRamp::loadPalette |
( |
| ) |
|
|
protected |
Generates the scheme using the current name and number of colors.
Definition at line 883 of file qgscolorrampimpl.cpp.
◆ properties()
| QVariantMap QgsColorBrewerColorRamp::properties |
( |
| ) |
const |
|
overridevirtual |
◆ schemeName()
| QString QgsColorBrewerColorRamp::schemeName |
( |
| ) |
const |
|
inline |
◆ setColors()
| void QgsColorBrewerColorRamp::setColors |
( |
int | colors | ) |
|
|
inline |
◆ setSchemeName()
| void QgsColorBrewerColorRamp::setSchemeName |
( |
const QString & | schemeName | ) |
|
|
inline |
◆ type()
| QString QgsColorBrewerColorRamp::type |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ typeString()
| QString QgsColorBrewerColorRamp::typeString |
( |
| ) |
|
|
inlinestatic |
◆ value()
| double QgsColorBrewerColorRamp::value |
( |
int | index | ) |
const |
|
overridevirtual |
◆ mColors
| int QgsColorBrewerColorRamp::mColors |
|
protected |
◆ mInverted
| bool QgsColorBrewerColorRamp::mInverted |
|
protected |
◆ mPalette
| QList<QColor> QgsColorBrewerColorRamp::mPalette |
|
protected |
◆ mSchemeName
| QString QgsColorBrewerColorRamp::mSchemeName |
|
protected |
The documentation for this class was generated from the following files: