aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-16 21:46:36 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-16 21:46:36 +0100
commit2251ea8e63bd513ce12e709a6fd27d12565bc169 (patch)
tree01f7b956780a1e2ae2f30260791298e12a9cd987
parentd3be9244993da832bb66ff728220b3abe666452e (diff)
ColorScale: minor rewrite on sampling method.
-rw-r--r--colorscale.h5
1 files changed, 1 insertions, 4 deletions
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;
}
}