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

QColor constructor/setters taking #rrrrggggbbbb and #aaaarrrrggggbbbb discard data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.11.2
    • Fix Version/s: 5.12.1
    • Component/s: GUI: Painting
    • Labels:
      None
    • Commits:
      2393551665a6dc608aa495d032d7408bd4b38297 (qt/qtbase/5.12)

      Description

      QColor documentation says that it's possible to build one from such a color string. However, the parsing discards the second byte of each channel, resulting in a loss of precision:

      For instance, QColor("#ff0000000000") has red == 1.0 instead of 0.996.

      Given that QColor can represent 16-bit color quantities exactly, this seems like an historical quirk.

        Attachments

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

          Activity

            People

            Assignee:
            allan.jensen Allan Sandfeld Jensen
            Reporter:
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes