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

[Question] Hook into color update? #22

Closed thednp closed 9 years ago

thednp commented 9 years ago

I was searching your doc and cound't find any clue, basically what I'm after is similar to

init: function(elem,colors){
//do some stuff
}

Yes, there is this

actionCallback: function(e,action) {}

But I don't know what are those function attributes for.

So yes, I would need to do some stuff on update.

Thanks so much.

thednp commented 9 years ago

I managed to make it work via renderCallback.

thednp commented 9 years ago

Hey there.

We need a way to have access to element in all callback functions. Can you please point out or make some improvements on this?

Thank you

thednp commented 9 years ago

I found that to get the element in the callback functions you can simply do

var myInput = this.input; //where this is the entire colorPicker object

But I think this should be documented.

PitPik commented 9 years ago

Hi @thednp sorry for the late answer,... I was not home for quite a while. Thanks for your point. I will update the documentations as soon as I find time. Cheers