2013-08-18 15:13:15 +00:00
|
|
|
#include "SmallPreviewHues.h"
|
|
|
|
|
|
|
|
#include <QPainter>
|
|
|
|
|
2013-11-12 20:34:35 +00:00
|
|
|
#include "tools.h"
|
2013-11-13 19:07:35 +00:00
|
|
|
#include "ColorHSL.h"
|
2013-08-18 15:13:15 +00:00
|
|
|
|
|
|
|
SmallPreviewHues::SmallPreviewHues(QWidget* parent) : DrawingWidget(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SmallPreviewHues::doDrawing(QPainter* painter)
|
|
|
|
{
|
2013-09-18 15:10:34 +00:00
|
|
|
int x;
|
|
|
|
ColorHSL colhsl;
|
|
|
|
|
|
|
|
colhsl.s = 1.0;
|
|
|
|
colhsl.l = 0.5;
|
|
|
|
colhsl.a = 1.0;
|
|
|
|
|
|
|
|
for (x = 0; x < width(); x++)
|
|
|
|
{
|
|
|
|
colhsl.h = (double)x / (double)(width() - 1);
|
|
|
|
painter->setPen(colorToQColor(colorFromHSL(colhsl)));
|
|
|
|
painter->drawLine(x, 0, x, height() - 1);
|
|
|
|
}
|
2013-08-18 15:13:15 +00:00
|
|
|
}
|