From 044eb56f2a332ef10927a8539ab1450b53add6b5 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sat, 19 Dec 2015 12:25:39 +0100 Subject: ColorScale: updated API to use float. The old qreal is only used internally now. --- colorscale.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'colorscale.h') 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 &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 m_colors; }; -- cgit v1.2.3