-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.0
-
3768a915bcf6aecf6bb445d7a6abfb78e505b4d7 (qt/qtbase/dev) 2cd77a1e22999d184708fec05ebc226eacec65cb (qt/qtbase/5.15)
The documentation says that the colors are equal if they have the same RGB and
alpha values (see: https://doc.qt.io/qt-5/qcolor.html#operator-eq-eq ).
However, It appears that also the types of colors are checked. Like if two colors with different spec, but same RGB and same alpha values, == returns false.
QColor col1(255, 255, 255, 255); QColor colHSV = col1.toHsv(); // copy of the color above in a HSV format qDebug() << "RGBAs are equal - " << (col1.rgba() == colHSV.rgba()); // Return true qDebug() << "Names are equal - " << (col1.name() == colHSV.name()); // Return true qDebug() << "Colors are equal - " << (col1 == colHSV); // Return False
Documentation should include this detail too.
- relates to
-
QTBUG-58147 Qt.colorEqual (and ==/===) does not work with hsv/hsl colors
-
- Reported
-
-
QTBUG-134722 ColorEqual fails correctly comparing rgba constructed colors with hsva constructed colors
-
- Open
-
-
QTBUG-125634 For some RGB values, the final QRgb value obtained by converting RGB to HSL and then back to RGB is not equal to the value before conversion
-
- Closed
-