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
572 stars 136 forks source link

simple jsFiddle with realistic example #7

Closed tammo0 closed 10 years ago

tammo0 commented 10 years ago

Hi @PitPik,

first of all: Thanks for your work! Your colorPicker looks amazing. Perhaps i dont get it and its the wrong Picker for my scenario, so please dont mind if i didnt understand your intention.

I looked at your examples and the demo page but i still dont get it.

This is what i try to get: You have a button which opens the colorPicker on click. It can have an initial color (eg by comming from a database or cookie). When you change the color with the picker i want to execute a function (eg. an ajax call or a function which updates styles of some elements with the new color). But i still dont get how to initialize it neighter how to listen to events.

Can you provide a simple jsFiddle?

Kind regards

PitPik commented 10 years ago

Hi tammo0,

thanks for the flowers ;o) I know, there is no implementation sample so far... I'm actually working on a jQuery implementation that takes care of all the events, the memory squares on the bottom, picking up the colors from an input-field or other element, storing user data, etc. but it's not good enough yet to publish it. I'm quite busy lately at work... so barely time to finish very soon, but if you send me a mail, I can provide you with a sneak preview...

Thanks and bis bald ;o) Peter

tammo0 commented 10 years ago

Hi @PitPik,

thanks a lot for your quick answer! I still dont know if it works for my scenario but here is a working example with the callback i need: http://jsfiddle.net/0kp8usmk/1/ For my setup i cant use jQuery but i'll follow your plugin because i really like the idea and functionality! Keep up the good work! :+1:

Bis bald, Tammo

PitPik commented 10 years ago

@tammo0, I update your fiddle a bit (http://jsfiddle.net/0kp8usmk/2/) where I also changed the external resources (to 3 separate un-minified so better readable) and uploaded some first trial of my jQuery implementation to http://www.dematte.at/cpn/jQuery_implementation/ I hope that helps for now... I'll update this git as soon as possible

PitPik commented 10 years ago

Latest update of fiddle: http://jsfiddle.net/0kp8usmk/5/ For further implementations see http://www.dematte.at/cpn/jQuery_implementation/ or https://github.com/PitPik/colorPicker/tree/master/jQuery_implementation

PitPik commented 9 years ago

@tammo0 Hi there,... there is now a jQuery and a javascript implementation available...

ghost commented 7 years ago

@PitPik please send the instance in renderCallback and in actionCallback, you don't need to work with the internal api if you send the color picker instance (cp-app) in the first parameter of both functions.

Please note: Will not be allowed have different behaviour for a particular instance by default, but also the instances can have a reference to the target element (input, button?) with an id and you can detect who instance is and if is belong to what target if you associate the picker to the target element internally.