simonwep / pickr

🎨 Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!
https://simonwep.github.io/pickr
MIT License
4.31k stars 285 forks source link

Add color to palette #252

Closed trushpatel97 closed 3 years ago

trushpatel97 commented 4 years ago

After choosing a color from the color picker, is there a way save a color to the swatches?

Like I know you can manually enter colors to the swatches, but is there a way I can pick a random color and add it to the list of swatches?

simonwep commented 4 years ago

See Methods - pickr.addSwatch([color]). Just listen to the save event and add the color afterwards ;)

yairEO commented 3 years ago

it would be nice if there was a setting which allows any color picked to automatically be added to the swatch palette (as FIFO).

It is highly-likely in many situations that one picked color would also be needed in another color input.

I have for example 20+ color inputs, and in some, the user will most likely want to reuse a few of the colors they already picked.

simonwep commented 3 years ago

Since you can do it that easily by just adding one line I wouldn't want to add this as an feature (and because it's feature-locked right now).

Example: https://jsfiddle.net/ztekfbLo/ You can, of course, use the .hide() method to hide it when a color has been set.