Am 08.11.2007 um 01:07 schrieb Andre Poenitz:
On Thu, Nov 08, 2007 at 12:01:16AM +0100, Stefan Schimanski wrote:
Nope, that's Stefan's work...
Stefan?
- return QColor(v*minr+(1-v)*maxr, v*ming+(1-v)*maxg, v*minb+(1-
v)*maxb);
+ QColor c;
+ c.setRgbF(v*minr+(1-v)*maxr, v*ming+(1-v)*maxg, v*minb+(1-
v)*maxb);
+ return c;
}
That was me most probably, yes. Is there an advantage in this
change (other
than a better C++ style)?
It's not a style issue. The problem is there is no QColor contructor
taking float values (at least not here) so you end up using the int
version wich takes values in the range 0..255 whereas your values are
0..1.
I see. In fact it is not in the docs either, so I doubt it's in the
headers here. So it must have been pure luck that the resulting color
is not too wrong.
Stefan