XX CMake Package
Loading...
Searching...
No Matches
XXRainbow.h
Go to the documentation of this file.
1#ifndef XXRainbowH
2#define XXRainbowH
3
4#include "XXGuiExportDef.h"
5
6#include <QColor>
7#include <QMap>
8
9namespace XX
10{
13
15 {
16 public:
17 Rainbow(quint64 maxIndex, quint16 shade = 200);
18
19 public:
20 const quint64& getMaxIndex() const;
21 void changeShade(quint16 shade);
22 QColor getColor(const quint64 offset = 0);
23 QColor advanceColor(const quint64& offset = 1);
24 QColor lookup(const quint64& value, bool wrap);
25
26 private:
27 using ColorMap = QMap<quint64, QColor>;
28
29 struct Section
30 {
31 QColor color;
32 int variableIndex;
33 bool up;
34
35 using List = QList<Section>;
36 };
37
38 private:
39 quint64 maxIndex;
40 ColorMap colorMap;
41 quint64 currentIndex;
42 };
43} // namespace XX
44
45#endif // NOT XXRainbowH
#define XXGUI_DECLSPEC
Definition XXGuiExportDef.h:11
Rainbow(quint64 maxIndex, quint16 shade=200)
void changeShade(quint16 shade)
QColor lookup(const quint64 &value, bool wrap)
QColor getColor(const quint64 offset=0)
const quint64 & getMaxIndex() const
QColor advanceColor(const quint64 &offset=1)
Definition XXPopulatedAbstract.h:11