PitPik / colorPicker

Advanced javaScript color picker and color conversion / calculation (rgb, hsv, hsl, hex, cmyk, cmy, XYZ, Lab, alpha, WCAG 2.0, ...)
http://www.dematte.at/colorPicker/
MIT License
570 stars 136 forks source link

hot to close the colorpicker panel? #40

Open ghost opened 8 years ago

ghost commented 8 years ago

I can't close the colorpicker panel when I click the "close icon".What's wrong ? Seems no relative API to do this.Can't figure it out .

PitPik commented 8 years ago

Hi @gdut-zdc , sorry for the veeeeeeery late answer. I was trying to find out what the problem was but couldn't find out what is wrong. If you use ./javascriptImplementation or ./jQueryImplementation I don't see why it shouldn't work. If you use colorPicker without those implementation, you just need to check against colorPicker.nodes.exit on a click (like in the implementations) and react on it. There is no API thingy with this. See ./jQueryImplementation/jqColor.js on line 145 or ./javascriptImplementation/jsColor.js on line 143 how it is done. If thats not the problem then please let me know.

Thanks and greetings Peter

ghost commented 6 years ago

Also an option to close the picker when click on save?

I add a wrap to all javascript components that i use and implemented the plug-in options in data- attributed. So i can leave the script untouched while i can set properties in my template. This option is missing and click outside the component to close the picker is not intuitive, i think.