From 2251ea8e63bd513ce12e709a6fd27d12565bc169 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sat, 16 Jan 2016 21:46:36 +0100 Subject: ColorScale: minor rewrite on sampling method. --- colorscale.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'colorscale.h') diff --git a/colorscale.h b/colorscale.h index 90671eb..1be315f 100644 --- a/colorscale.h +++ b/colorscale.h @@ -35,16 +35,13 @@ void ColorScale::sample(int samples, OutputIterator it) const return; } - float t = min(); float step = (max() - min()) / samples; qreal r, g, b; - for (unsigned i = 0; i < 3*samples; i += 3) { + for (float t = min(); t < max(); t += step) { color(t).getRgbF(&r, &g, &b); *it = r; it++; *it = g; it++; *it = b; it++; - - t += step; } } -- cgit v1.2.3