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

Qt.colorEqual (and ==/===) does not work with hsv/hsl colors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.8.0 RC, 5.9.1
    • None
    • Linux yoga 4.7.6-1-ARCH #1 SMP PREEMPT Fri Sep 30 19:28:42 CEST 2016 x86_64 GNU/Linux

      Testcase:

      import QtQuick 2.0
      import QtTest 1.0
      
      TestCase {
        name: "color"
        property color tmp: '#800000'
        property color tmp2
      
        function test_hsv_set() {
          tmp2 = tmp
          tmp2.hsvHue = 0
          console.log(
            tmp,
            [tmp.r, tmp.g, tmp.b, tmp.a],
            [tmp.hsvHue, tmp.hsvSaturation, tmp.hsvValue, tmp.hslLightness]
          )
          console.log(
            tmp2,
            [tmp2.r, tmp2.g, tmp2.b, tmp2.a],
            [tmp2.hsvHue, tmp2.hsvSaturation, tmp2.hsvValue, tmp2.hslLightness]
          )
          verify(Qt.colorEqual(tmp, "#800000"), "tmp")
          verify(Qt.colorEqual(tmp2, "#800000"), "tmp2")
          verify(Qt.colorEqual(tmp, tmp2), "tmp == tmp2")
        }
      
        function test_hsl_set() {
          tmp2 = tmp
          tmp2.hslHue = 0
          verify(Qt.colorEqual(tmp, "#800000"), "tmp")
          verify(Qt.colorEqual(tmp2, "#800000"), "tmp2")
          verify(Qt.colorEqual(tmp, tmp2), "tmp == tmp2")
        }
      }
      

      Note that the original hue is 0 and the assigned hue is also 0, and that all properties are equal.

      Refs: https://github.com/qmlweb/qmlweb/pull/386

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

            srutledg Shawn Rutledge
            chalker Сковорода Никита
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes