Opened 10 years ago

Closed 8 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:


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:

The implementation in dojo differs a little bit, are you sure about your implementation ?

Change History (8)

comment:1 Changed 10 years ago by bill

Cc: Tom Trenka added
Owner: set to Eugene Lazutkin

Not sure who this should go to, maybe Eugene?

comment:2 Changed 10 years ago by Adam Peller

Component: GeneralDojox

comment:3 Changed 10 years ago by Tom Trenka

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 10 years ago by Enzo

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:

(convention followed by

comment:5 Changed 10 years ago by Tom Trenka

Milestone: tbd1.8
Priority: highlow
Status: newassigned

comment:6 Changed 10 years ago by Tom Trenka

Keywords: reviewed added

comment:7 Changed 9 years ago by Colin Snover

Milestone: 1.82.0

1.8 has been tagged; moving all outstanding tickets to next major release milestone.

comment:8 Changed 8 years ago by Tom Trenka

Resolution: wontfix
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.