You found a bug! We've classified it as EXTGWT-2763 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    22
    Vote Rating
    0
    Andreas Samjeske is on a distinguished road

      0  

    Default RGB out of HSL delivers wrong color if hue is 0

    RGB out of HSL delivers wrong color if hue is 0


    Required Information

    Version(s) of Ext GWT
    Ext GWT 3.0b and 3.1

    Browser versions and OS
    doesn't matter

    Virtual Machine
    doesn't matter

    Description
    There is a bug in RGB calculation out of an HSL. It seem like, it only appears, if the hue is zero. The resulting RGB is always a shade of grey (r=g=b).

    Run mode
    Only tested in development mode.

    Steps to reproduce the problem
    Initilize an RGB with a given HSL with hue = 0.
    See example below.

    Expected result
    RGB in shade of red.

    Actual result
    RGB in shade of grey.

    Test case
    Code:
            RGB rgb = new RGB(new HSL(new RGB(255, 0, 0)));
            GWT.log(rgb.getColor());  // rgb(128, 128, 128)   <<<--- WRONG
            rgb = new RGB(new HSL(new RGB(255, 1, 0)));
            GWT.log(rgb.getColor());  // rgb(255, 1, 0)   <<<--- Right
    Debugging already done
    • In gxt-chart-3.0.0b.jar com.sencha.gxt.chart.client.draw.RGB line 112:
      if (h == 0 || s == 0) {
      shall be
      if (s == 0) {

      The shortcut to set r, g and b each to l seems only correct, if s==0.

    Workaround
    Don't use the RGB(HSL hsl) - Constructer. At least not when hue is zero.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Posts
    1,924
    Vote Rating
    55
    Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough

      0  

    Default


    Thanks for the report, and for the workaround. I have opened a bug in our bug tracker, and will update this thread when we have have made any changes for this.

Tags for this Thread