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

"green" is an accepted value but "red" is not #144

Closed jooleeunc closed 7 years ago

jooleeunc commented 7 years ago

I created a JSBin of a basic demo of the color picker with $error object.

https://jsbin.com/fatinapana/1/edit?js,output

You'll see that "green" is valid while "red" is not. It's because of Line 42:

https://github.com/ruhley/angular-color-picker/blob/master/src/scripts/controller.js#L42

What's the purpose of this if check "newValue.length > 4"? Could we remove it?

ruhley commented 7 years ago

I think the limit of 4 characters was put in an early version as a work around to another problem. I have removed it as it is no longer required

jooleeunc commented 7 years ago

Thanks for such a quick response!