bgrins / spectrum

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

feature: ability to add to selection palette with code #533

Open rob-lindman opened 6 years ago

rob-lindman commented 6 years ago

would like to be able to dynamically add color(s) to the selection palette with code.

for example:

$("#clr-border").spectrum.selectionPalette.add("#c0c0c0");

perhaps also this would have a parameter for the localstorage keys.

right now the only obviously apparent way is to select a color manually. I have an eyedropper tool which grabs a color from the canvas and it would be nice if that color was added to the selection palette.