ruhley / angular-color-picker

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

Rounding of HEX values #131

Closed shanizar closed 7 years ago

shanizar commented 7 years ago

If I choose "hex" as format the color picker will change my stored value just by opening the picker. I'm pretty sure this is because of the rounding of values done in the directive.

Example: set model value to "#123456". Open color-picker and it will change to "#123457"

shanizar commented 7 years ago

I changed Math.round(variable 100) to Math.round(variable 10000)/100 in watchNgModel function at it seems to fix the problem.

ruhley commented 7 years ago

@shanizar I cannot replicate this issue on the latest version. There was an issue in v2.6.0 which you can see here - https://github.com/ruhley/angular-color-picker/issues/124. If you are using the latest version can you tell me more about your environment (os, browser, etc) and create a plunker that replicates the issue.

shanizar commented 7 years ago

@ruhley I'm sorry, code was still using v2.6.1. You are quite right, the issue is fixed in the latest version. Thank you for the reply.