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

QML canvas javascript hsl function broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.5.1
    • 5.5.0
    • None
    • Mac OS

    Description

      The javascript hsl(hue, saturation, lightness) is not work as exepected. The hue should go from 0->360 however it seems Qt uses a char for hue thus our max value is 0->255. You can prove this using the following code:

      In a Canvas in the onpaint() function:

      ctx.strokeStyle = 'hsl(255, 100%, 50%)';
      console.log("before = " + ctx.strokeStyle);
      ctx.strokeStyle = 'hsl(320, 100%, 50%)';
      console.log("after = " + ctx.strokeStyle)

      You will notice you get the same #hex color out of it.

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            gimp3695 Joshua Hintze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes