blob: 6e1212d12c0ea742fa47da9908b29072d4d0b850 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
|