16 #ifndef QGSVECTORCOLORRAMPV2_H
17 #define QGSVECTORCOLORRAMPV2_H
31 virtual int count()
const = 0;
34 virtual double value(
int index )
const = 0;
36 virtual QColor color(
double value )
const = 0;
38 virtual QString type()
const = 0;
55 #define DEFAULT_GRADIENT_COLOR1 QColor(0,0,255)
56 #define DEFAULT_GRADIENT_COLOR2 QColor(0,255,0)
63 bool discrete =
false,
68 virtual int count()
const {
return mStops.count() + 2; }
72 virtual QColor
color(
double value )
const;
74 virtual QString
type()
const {
return "gradient"; }
80 QColor
color1()
const {
return mColor1; }
81 QColor
color2()
const {
return mColor2; }
87 void convertToDiscrete(
bool discrete );
97 void addStopsToGradient( QGradient* gradient );
106 #define DEFAULT_RANDOM_COUNT 10
107 #define DEFAULT_RANDOM_HUE_MIN 0
108 #define DEFAULT_RANDOM_HUE_MAX 359
109 #define DEFAULT_RANDOM_VAL_MIN 200
110 #define DEFAULT_RANDOM_VAL_MAX 240
111 #define DEFAULT_RANDOM_SAT_MIN 100
112 #define DEFAULT_RANDOM_SAT_MAX 240
126 virtual QColor
color(
double value )
const;
128 virtual QString
type()
const {
return "random"; }
136 int count()
const {
return mCount; }
154 int mHueMin, mHueMax, mSatMin, mSatMax,
mValMin, mValMax;
168 QColor
color(
double value )
const;
170 QString
type()
const;
178 #define DEFAULT_COLORBREWER_SCHEMENAME "Spectral"
179 #define DEFAULT_COLORBREWER_COLORS 5
191 virtual QColor
color(
double value )
const;
193 virtual QString
type()
const {
return "colorbrewer"; }
200 virtual int count()
const {
return mColors; }
203 void setSchemeName( QString schemeName ) { mSchemeName = schemeName; loadPalette(); }
204 void setColors(
int colors ) { mColors = colors; loadPalette(); }
206 static QStringList listSchemeNames();
207 static QList<int> listSchemeVariants( QString schemeName );
219 #define DEFAULT_CPTCITY_SCHEMENAME "cb/div/BrBG_" //change this
220 #define DEFAULT_CPTCITY_VARIANTNAME "05"
227 bool doLoadFile =
true );
229 QString variantName = QString(),
bool doLoadFile =
true );
233 virtual QString
type()
const {
return "cpt-city"; }
246 void setSchemeName( QString schemeName ) { mSchemeName = schemeName; mFileLoaded =
false; }
247 void setVariantName( QString variantName ) { mVariantName = variantName; mFileLoaded =
false; }
249 void setName( QString schemeName, QString variantName =
"", QStringList variantList = QStringList() )
250 { mSchemeName = schemeName; mVariantName = variantName; mVariantList = variantList; mFileLoaded =
false; }
255 QString fileName()
const;
259 QString copyingFileName()
const;
260 QString descFileName()
const;