15 #ifndef QGSCOLORBREWERPALETTE_H 16 #define QGSCOLORBREWERPALETTE_H 18 #include "qgis_core.h" 34 QString palette( BREWER_STRING );
35 QStringList list = palette.split( QChar(
'\n' ) );
36 Q_FOREACH (
const QString &entry, list )
38 QStringList items = entry.split( QChar(
'-' ) );
39 if ( items.count() != 3 || items[0] != schemeName || items[1].toInt() != colors )
41 QStringList colors = items[2].split( QChar(
' ' ) );
42 Q_FOREACH (
const QString &clr, colors )
54 QString palette( BREWER_STRING );
55 QStringList list = palette.split( QChar(
'\n' ) );
56 Q_FOREACH (
const QString &entry, list )
58 QStringList items = entry.split( QChar(
'-' ) );
59 if ( items.count() != 3 )
61 if ( !schemes.contains( items[0] ) )
71 QString palette( BREWER_STRING );
72 QStringList list = palette.split( QChar(
'\n' ) );
73 Q_FOREACH (
const QString &entry, list )
75 QStringList items = entry.split( QChar(
'-' ) );
76 if ( items.count() != 3 || items[0] != schemeName )
78 variants << items[1].toInt();
90 #endif // QGSCOLORBREWERPALETTE_H static const char * BREWER_STRING
static QList< QColor > listSchemeColors(const QString &schemeName, int colors)
static QColor parseColor(const QString &colorStr, bool strictEval=false)
Attempts to parse a string as a color using a variety of common formats, including hex codes...
static QList< int > listSchemeVariants(const QString &schemeName)
static QStringList listSchemes()