Threaded View
-
17 Jan 2013 6:45 AM #1
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
Debugging already doneCode: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- 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.
- In gxt-chart-3.0.0b.jar com.sencha.gxt.chart.client.draw.RGB line 112:
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.


Reply With Quote