16 #ifndef QGSVECTORCOLORRAMPV2_H
17 #define QGSVECTORCOLORRAMPV2_H
30 virtual int count()
const = 0;
33 virtual double value(
int index )
const = 0;
35 virtual QColor color(
double value )
const = 0;
37 virtual QString type()
const = 0;
54 #define DEFAULT_GRADIENT_COLOR1 QColor(0,0,255)
55 #define DEFAULT_GRADIENT_COLOR2 QColor(0,255,0)
62 bool discrete =
false,
67 virtual int count()
const {
return mStops.count() + 2; }
69 virtual double value(
int index )
const;
71 virtual QColor
color(
double value )
const;
73 virtual QString
type()
const {
return "gradient"; }
79 QColor
color1()
const {
return mColor1; }
80 QColor
color2()
const {
return mColor2; }
86 void convertToDiscrete(
bool discrete );
101 #define DEFAULT_RANDOM_COUNT 10
102 #define DEFAULT_RANDOM_HUE_MIN 0
103 #define DEFAULT_RANDOM_HUE_MAX 359
104 #define DEFAULT_RANDOM_VAL_MIN 200
105 #define DEFAULT_RANDOM_VAL_MAX 240
106 #define DEFAULT_RANDOM_SAT_MIN 100
107 #define DEFAULT_RANDOM_SAT_MAX 240
119 virtual double value(
int index )
const;
121 virtual QColor
color(
double value )
const;
123 virtual QString
type()
const {
return "random"; }
131 int count()
const {
return mCount; }
149 int mHueMin, mHueMax, mSatMin, mSatMax,
mValMin, mValMax;
154 #define DEFAULT_COLORBREWER_SCHEMENAME "Spectral"
155 #define DEFAULT_COLORBREWER_COLORS 5
165 virtual double value(
int index )
const;
167 virtual QColor
color(
double value )
const;
169 virtual QString
type()
const {
return "colorbrewer"; }
176 virtual int count()
const {
return mColors; }
179 void setSchemeName( QString schemeName ) { mSchemeName = schemeName; loadPalette(); }
180 void setColors(
int colors ) { mColors = colors; loadPalette(); }
182 static QStringList listSchemeNames();
183 static QList<int> listSchemeVariants( QString schemeName );
195 #define DEFAULT_CPTCITY_SCHEMENAME "cb/div/BrBG_" //change this
196 #define DEFAULT_CPTCITY_VARIANTNAME "05"
203 bool doLoadFile =
true );
205 QString variantName = QString(),
bool doLoadFile =
true );
209 virtual QString
type()
const {
return "cpt-city"; }
222 void setSchemeName( QString schemeName ) { mSchemeName = schemeName; mFileLoaded =
false; }
223 void setVariantName( QString variantName ) { mVariantName = variantName; mFileLoaded =
false; }
225 void setName( QString schemeName, QString variantName =
"", QStringList variantList = QStringList() )
226 { mSchemeName = schemeName; mVariantName = variantName; mVariantList = variantList; mFileLoaded =
false; }
231 QString fileName()
const;
235 QString copyingFileName()
const;
236 QString descFileName()
const;