Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color palette #13

Open
daviedR opened this issue Feb 10, 2019 · 4 comments
Open

Color palette #13

daviedR opened this issue Feb 10, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@daviedR
Copy link

daviedR commented Feb 10, 2019

Hi,

Is there any chance you would add color palette features? It could be implemented as an additional option of the color picker.

@Sphinxxxx Sphinxxxx added the enhancement New feature or request label Feb 11, 2019
@Sphinxxxx
Copy link
Owner

That sounds like a nice feature for "a future version". Do you have any more details on how you'd like that to work/look?

@daviedR
Copy link
Author

daviedR commented Feb 12, 2019

Maybe something like this?

untitled-1

So user can provide the color palette in array format to the options. It should work with the setOption method too.

@Sphinxxxx
Copy link
Owner

Looks good! Leaving this open for now (pull request welcome).

@satchamo
Copy link

I hacked together a prototype using the existing API, if anyone wants to use it:

https://jsfiddle.net/403q8bfs/

(By the way, vanilla-picker is a fantastic library Sphinxxxx. Thank you for all the work you've put into it!)

If someone does integrate something like this into the core API, I'd recommend making the "palette" option (or whatever you call it) accept a callback function (in addition to an array of colors). This would support populating the palette dynamically (which comes in handy if your palette needs to show colors the user picked from other picker instances).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants