Opened 9 years ago
Closed 7 years ago
#13705 closed defect (wontfix)
dojox.color.toHsl might give bad results
Reported by: | Enzo | Owned by: | Tom Trenka |
---|---|---|---|
Priority: | low | Milestone: | 2.0 |
Component: | Dojox | Version: | 1.6.1 |
Keywords: | reviewed | Cc: | Tom Trenka |
Blocked By: | Blocking: |
Description
I'm using this function on rgb(233, 205, 211).
This function gives: Object { h=-12.857142857142819, s=39, l=86}
I really don't understand why h is negative, it should be a value between 0 and 360 (h is a degree). Maybe the following post process is needed: h = (360 + h) % 360, keep it above 0
Indeed, I was switching from my php implementation rgb2hsl to dojox.color, my implementation uses: http://www.easyrgb.com/index.php?X=MATH&H=18#text18
The implementation in dojo differs a little bit, are you sure about your implementation ?
Change History (8)
comment:1 Changed 9 years ago by
Cc: | Tom Trenka added |
---|---|
Owner: | set to Eugene Lazutkin |
comment:2 Changed 9 years ago by
Component: | General → Dojox |
---|
comment:3 Changed 9 years ago by
Owner: | changed from Eugene Lazutkin to Tom Trenka |
---|
This one is mine, and it was well tested since I added it circa 1.2/1.3; but I will take a look at it when I am back from vacation.
comment:4 Changed 9 years ago by
Well, H being an angle, this value for H as -12.857142857142819 is 'correct', it's the same as 360-12.857142857142819, or the same as 360 * 2 -12.857142857142819
But however the convention is to send a H between 0 and 360, as you can see here: http://en.wikipedia.org/wiki/HSL_and_HSV
(convention followed by EasyRGB.com)
comment:5 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|---|
Priority: | high → low |
Status: | new → assigned |
comment:6 Changed 9 years ago by
Keywords: | reviewed added |
---|
comment:7 Changed 8 years ago by
Milestone: | 1.8 → 2.0 |
---|
1.8 has been tagged; moving all outstanding tickets to next major release milestone.
comment:8 Changed 7 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Given the age of these tickets and the small nature of them, I'm marking all as won't fix. #1395 was somewhat addressed with the implementation of SHA2 in DTK 1.8.
Not sure who this should go to, maybe Eugene?