lauren / pick-a-color

an easy-to-use jQuery color picker for Twitter Bootstrap
http://lauren.github.com/pick-a-color/
MIT License
269 stars 89 forks source link

Should not default to #000000 on init when input's initial value is blank #25

Closed san closed 10 years ago

san commented 11 years ago

Hi, I have a color field in my form which is optional. So, my default value is supposed to be blank, but when "pick-a-color" is initialized, it defaults to #000000 instead of blank. I tracked down the code and found this:

myColorVars.defaultColor = tinycolor($thisEl.val()).toHex();

It's actually tinycolor which returns #000000 even when the val() is blank. I think it would be nice to allow blank value on init.

What do you think.

Thanks, San

lauren commented 10 years ago

Fixed in your pull request https://github.com/lauren/pick-a-color/pull/27