Skip to content

Commit 8f93a9b

Browse files
committed
Bug #124 remove some rounding that could interfere when translating between color types
1 parent b34d7ba commit 8f93a9b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/scripts/controller.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ export default class AngularColorPickerController {
4747

4848
if (this.options.round) {
4949
hsl = color.toHsl();
50-
this.lightness = Math.round(hsl.l * 100);
50+
this.lightness = hsl.l * 100;
5151
} else {
5252
hsl = color.toHsv();
53-
this.lightness = Math.round(hsl.v * 100);
53+
this.lightness = hsl.v * 100;
5454
}
5555

56-
this.hue = Math.round(hsl.h);
57-
this.saturation = Math.round(hsl.s * 100);
56+
this.hue = hsl.h;
57+
this.saturation = hsl.s * 100;
5858

5959
this.updateModel = false;
6060

@@ -778,7 +778,7 @@ export default class AngularColorPickerController {
778778
var hsl = color.toHsl();
779779
hsl.l = 50;
780780
hsl = tinycolor(hsl);
781-
781+
782782
el.css({
783783
'background': 'linear-gradient(to bottom, #FFFFFF 0%, ' + hsl.toHexString() + ' 50%, #000000 100%)'
784784
});

0 commit comments

Comments
 (0)