diff options
Diffstat (limited to 'colorscale.h')
-rw-r--r-- | colorscale.h | 24 |
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 |