[Interest] QColor( Qt::black ).lighter() == QColor( Qt::black )

Scott Bloom scott at towel42.com
Mon Aug 2 20:13:57 CEST 2021


While I understand the logic in the "lighter" (and darker) code, which basically converts to a HSV then uses the value sent into lighter (or darker) on the HSV value to compute the new value, then convert to RGB and return.

It fails when the color being lightened is black, is the HSV V = 0, multiplying it of course yields the same 0.

IMO, this is a bug, and needs a corner case  if statement (ie, if V = 0, v = 10... ) but not being a HSV expert (heck barely a noob when it comes to HSV manipulation) I have no idea what the new value should be for a given V being sent into lighter.

Any ideas?

Scott


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210802/e3dfa94b/attachment.html>


More information about the Interest mailing list