Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.13.0 Beta3
-
None
Description
It is - both by the documentation (e.g. QColor::fromHsvF and QML's hsva method) and the implementation - absolutely ok to create a QColor with a hue value of 1 (QColor::fromHsvF).
When retrieving the (non-float) hue value via QColor::getHsv, the result is 360. But the valid range for hue values in hsv representation is 0 - 359 (inclusive), as documented in several locations of the QColor class, and enforced in the code (e.g. QColor::fromHsv), as this little snippets shows:
QColor c = QColor::fromHsvF(1, 0, 0); int h = 0, s, v; c.getHsv(&h, &s, &v); qDebug() << h; // 360
Imho, it should be disallowed to set a hue value of 1.0 (because the actual range is between 0 (inclusive) to 1 (exclusive)) or at least a value of 1.0 should be sanitized to 0.