aboutsummaryrefslogtreecommitdiff
path: root/colorscale.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-05-18 18:33:50 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-05-18 18:33:50 -0300
commit7c4333eed407886114f33d803a3199c50556e4e3 (patch)
tree0f46c89bc7eaa08994faa1095b480baaa1f64c72 /colorscale.h
parent54571b4a4dcc076923325ee09ad348f389fc25a5 (diff)
Updated UI.
- Removed unnecessary UI elements from QML file; - Added the ColorScale class and implemented glyph color mapping from class labels; - Mark geometry nodes of individual glyphs as dirty when updating the schene graph.
Diffstat (limited to 'colorscale.h')
-rw-r--r--colorscale.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/colorscale.h b/colorscale.h
new file mode 100644
index 0000000..6e1212d
--- /dev/null
+++ b/colorscale.h
@@ -0,0 +1,24 @@
+#ifndef COLORSCALE_H
+#define COLORSCALE_H
+
+#include <initializer_list>
+#include <QColor>
+#include <QList>
+
+class ColorScale
+{
+public:
+ ColorScale(const QColor &firstColor, const QColor &lastColor);
+ ColorScale(std::initializer_list<QColor> colors);
+ ColorScale(const QList<QColor> &colors);
+ ~ColorScale();
+
+ void setExtents(qreal min, qreal max);
+ QColor color(qreal t) const;
+
+private:
+ qreal m_min, m_max;
+ QList<QColor> m_colors;
+};
+
+#endif // COLORSCALE_H