Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82296

QColor lighter and darker methods do not have color model specified in naming

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 4.3.5, 4.4.3, 4.5.3, 4.6.3, 4.7.4, 4.8.x, 5.1.1, 5.2.1, 5.3.2, 5.4.2, 5.5.1, 5.6, 5.7, 5.8, 5.9, 5.10, 5.11, 5.12, 5.13, 5.14, 5.15
    • None
    • All

    Description

      QColor has darker and lighter methods since Qt4.3, and my hypothesis is that their naming is not intuitive enough.

      (Slightly related issue)

      In my opinion, contradictory is here in the naming because the word lighter implies HSL (lightness) color model usage.

      But the actual methods utilize the HSB palette (aka HSV), which is not equivalent to HSL.

      To paraphrase, we have darker and lighter methods that work in HSB (brightness) not HSL (lightness) palette. As expected from HSB, we are getting a wildly bright color (for example, acid green) when twisting the input parameter to the maximum ceteris paribus.

      At the same time, when we are talking about HSL (lightness) color model, it is expected that twisting the input parameter to the maximum leads to white color ceteris paribus.

      Does it make sense to propose re-wording the methods? �

      Similar to the other QColor naming, for the old ones (darker and lighter) give new names like hsvDarker and hsvBrighter saving the current logic. If my reasoning is right, it also makes sense to propose new hslDarker and hslLighter methods.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            aa13q Alexey Andreyev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes