bgrins / spectrum

The No Hassle JavaScript Colorpicker
https://bgrins.github.io/spectrum/
MIT License
2.32k stars 588 forks source link

Reset / Clear method #580

Open Barahten opened 2 years ago

Barahten commented 2 years ago

Is there a method in the plugin that allows you to clear the field (analogous to clicking on the Reset button)

thomedpete commented 1 year ago

From what I can tell so far there is not an outright 'clear' method you can use the 'set' method and pass an empty string, or the string 'clear' $("#color-picker").spectrum("set", ""); $("#color-picker").spectrum("set", "clear");

hope this helps