diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-12-19 12:25:39 +0100 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-12-19 12:25:39 +0100 |
commit | 044eb56f2a332ef10927a8539ab1450b53add6b5 (patch) | |
tree | 83affa8c6f45d1f2cc25216e61878f9eeb42def4 /colorscale.h | |
parent | a184000e2086c0d86d5aef20d715f5e884a63ff3 (diff) |
ColorScale: updated API to use float.
The old qreal is only used internally now.
Diffstat (limited to 'colorscale.h')
-rw-r--r-- | colorscale.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/colorscale.h b/colorscale.h index 6e65012..af74b5c 100644 --- a/colorscale.h +++ b/colorscale.h @@ -13,11 +13,15 @@ public: ColorScale(const QList<QColor> &colors); virtual ~ColorScale(); - virtual QColor color(qreal t) const; - void setExtents(qreal min, qreal max); + QColor operator ()(float t) const { return color(t); } + virtual QColor color(float t) const; + + void setExtents(float min, float max); + float min() const { return m_min; } + float max() const { return m_max; } protected: - qreal m_min, m_max; + float m_min, m_max; QList<QColor> m_colors; }; |