Open sean-zou opened 11 years ago
I had the same problem, the color #e73e2c is rounded to #e73f2c
Since the function HSBToRGB already round the numbers in the end, we do not need the round in the start:
//var h = Math.round(hsb.h);
//var s = Math.round(hsb.s*255/100);
//var v = Math.round(hsb.b*255/100);
var h = hsb.h;
var s = hsb.s*255/100;
var v = hsb.b*255/100;
It solved the problem
HSBToRGB method use rounded hsb value to calculate the rgb value, sometimes it changes the user input rgb values, it does not look right from a user perspective.
For example, enter R 0 G 255 B 63, then it will change B to 64.
proposed fix is to remove the round call on hsb values.