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

Select color programmatically #65

Open yintothayang opened 9 years ago

yintothayang commented 9 years ago

Is there a way I can select a color programmatically? just changing the $.val() does not change the color in the preview.

frangin2003 commented 9 years ago

You need to call updatePreview to update the color of square preview to the right. Since updatePreview is not exposed, I've created a version of pick-a-color with this possibility: https://github.com/frangin2003/pick-a-color/commit/43963e438e9c3e8002f19f85bfa3a8c6df3776e9 See fiddle here to demo: http://jsfiddle.net/frangin2003/yy8uxmjh/

charleslaw commented 8 years ago

This solution sets the color of the preview but does not actually set the values of the H/S/L.

charleslaw commented 8 years ago

I ended up needing to set them programmatically, so I made the changes here:https://github.com/lauren/pick-a-color/pull/81

isi-dwade commented 4 years ago

See issue #94 for a quick solution