summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcolor.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-01-26 13:37:45 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2011-01-26 14:18:25 +0100
commit88c1670a658d55257d50181d741afe562e44344b (patch)
tree3ecb9434f1ed79b358c475d5b6ca5d47e66be1e5 /src/gui/painting/qcolor.cpp
parent6ef6adb7d6ba8408772c11c6190bc12960435c79 (diff)
Fixed hslHue / hslHueF returning the wrong value for achromatic QColors.
Made toHsl() work the same way as toHsv(), ensuring the hue gets set to USHRT_MAX and not 0. Task-number: QTBUG-16530 Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src/gui/painting/qcolor.cpp')
-rw-r--r--src/gui/painting/qcolor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index dea3a72805..173fb71c8a 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -1781,7 +1781,7 @@ QColor QColor::toHsl() const
color.ct.ahsl.lightness = qRound(lightness * USHRT_MAX);
if (qFuzzyIsNull(delta)) {
// achromatic case, hue is undefined
- color.ct.ahsl.hue = 0;
+ color.ct.ahsl.hue = USHRT_MAX;
color.ct.ahsl.saturation = 0;
} else {
// chromatic case