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

Unable to Use hexString Format with restrictToFormat #173

Closed myerscw closed 7 years ago

myerscw commented 7 years ago

If the format of the picker is set to "hexString" and restrictToFormat is true, isColorValid returns false because of:

if (isValid && this.options.restrictToFormat) {
  isValid = color.getFormat() === this.options.format;
}

tinycolor returns the format from getFormat() as "hex" for a value like "#ff0000" which will get compared to "hexString".

Using tinycolor2 1.4.1 and angular-color-picker 3.4.4

ruhley commented 7 years ago

This has been fixed in commit dbc042e and released in v3.4.5