2 #ifndef QGSVECTORCOLORRAMPV2_H
3 #define QGSVECTORCOLORRAMPV2_H
14 virtual QColor color(
double value )
const = 0;
16 virtual QString type()
const = 0;
24 #define DEFAULT_GRADIENT_COLOR1 QColor(0,0,255)
25 #define DEFAULT_GRADIENT_COLOR2 QColor(0,255,0)
35 virtual QColor
color(
double value )
const;
37 virtual QString
type()
const {
return "gradient"; }
43 QColor
color1()
const {
return mColor1; }
44 QColor
color2()
const {
return mColor2; }
59 #define DEFAULT_RANDOM_COUNT 10
60 #define DEFAULT_RANDOM_HUE_MIN 0
61 #define DEFAULT_RANDOM_HUE_MAX 359
62 #define DEFAULT_RANDOM_VAL_MIN 0
63 #define DEFAULT_RANDOM_VAL_MAX 255
64 #define DEFAULT_RANDOM_SAT_MIN 0
65 #define DEFAULT_RANDOM_SAT_MAX 255
77 virtual QColor
color(
double value )
const;
79 virtual QString
type()
const {
return "random"; }
87 int count()
const {
return mCount; }
88 int hueMin()
const {
return mHueMin; }
89 int hueMax()
const {
return mHueMax; }
90 int satMin()
const {
return mSatMin; }
91 int satMax()
const {
return mSatMax; }
92 int valMin()
const {
return mValMin; }
93 int valMax()
const {
return mValMax; }
105 int mHueMin, mHueMax, mSatMin, mSatMax,
mValMin, mValMax;
110 #define DEFAULT_COLORBREWER_SCHEMENAME "Spectral"
111 #define DEFAULT_COLORBREWER_COLORS 5
121 virtual QColor
color(
double value )
const;
123 virtual QString
type()
const {
return "colorbrewer"; }
132 void setSchemeName( QString schemeName ) { mSchemeName = schemeName; loadPalette(); }
133 void setColors(
int colors ) { mColors = colors; loadPalette(); }
135 static QStringList listSchemeNames();
136 static QList<int> listSchemeVariants( QString schemeName );