ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
165 stars 78 forks source link

Color Picker changing the color of the supplied model. #7

Closed enigmak closed 9 years ago

enigmak commented 9 years ago

When setting the ng-model to certain colors the model value is changed for instance #FAFCFC becomes #34FCFC. This issue also shows up when moving the color picker around the left edge of the color palette. You can see the issue on your demo page by trying to select colors close to the left edge or bottom of the palette.

I fixed this by changing line 95 to

                    var color = tinycolor({h: $scope.hue, s: $scope.saturation/100, v: $scope.lightness/100}),

Not sure if this is a good solution as it seems like the picker has issues on the bottom and far right this way.

You can see the fixed code at, and the fork shows it before it was fixed. http://plnkr.co/edit/8ZMOABpjn7nEs9c3Z483?p=preview

ruhley commented 9 years ago

Fixed in 3cee42d5528f2f1d597e30a0e5c66a102b592323 and released in v0.3.2.

Thanks for debugging and posting the solution.