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

Qcolor Class / color QML value type cannot be copied via HSL values

    XMLWordPrintable

Details

    • aac4168a7 (dev), 509ef252a (6.8)

    Description

      A reproducer attached.

      Issue:
      A color information (Qcolor Class / color QML value type) cannot be fully copied via HSL values.
      For example, this code snippet shows that the color B and C have different color information even color B is initialized based on color C.

      var C = "#bbbbbb"
      var B = Qt.hsla(C.hslHue, C.hslSaturation, C.hslLightness)
      console.log(C, C.hslHue, C.hslSaturation, C.hslLightness)
      console.log(B, B.hslHue, B.hslSaturation, B.hslLightness)

      And the result is :
      #bbbbbb -1 0 0.7333333492279053 
      #bbbbbb 0 0 0.7333333492279053

       

      The document "QColor Class - The HSV Color Model" (https://doc.qt.io/qt-6/qcolor.html#the-hsv-color-model ) says "Qt returns a hue value of -1 for achromatic colors.", but this specification seems causing this loss of information mentioned above.

      Attachments

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

        Activity

          People

            tvete Paul Olav Tvete
            hitoshiito Hitoshi Ito
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes