Improved area labels layout
[GPXSee.git] / src / GUI / palette.h
blobc57266394d70bfa502fd8b37bd5d68e05d8ccf19
1 #ifndef PALETTE_H
2 #define PALETTE_H
4 #include <QColor>
5 #include <QDebug>
7 class Palette
9 public:
10 Palette(const QColor &color = Qt::blue, qreal shift = 0.62);
12 QColor color() const {return QColor::fromHsvF(_h, _s, _v, _a).toRgb();}
13 qreal shift() const {return _shift;}
14 void setColor(const QColor &color);
15 void setShift(qreal shift);
17 QColor nextColor();
18 void reset();
20 bool operator==(const Palette &other) const
21 {return (_h == other._h && _s == other._s && _v == other._v
22 && _a == other._a && _shift == other._shift);}
23 bool operator!=(const Palette &other) const
24 {return !(*this == other);}
26 private:
27 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
28 qreal _h, _s, _v, _a, _shift;
29 qreal _state;
30 #else // QT6
31 float _h, _s, _v, _a, _shift;
32 float _state;
33 #endif // QT6
36 #ifndef QT_NO_DEBUG
37 QDebug operator<<(QDebug dbg, const Palette &palette);
38 #endif // QT_NO_DEBUG
40 #endif // PALLETE_H