PitPik / tinyColorPicker

Tiny jQuery color picker for mobile and desktop with alpha channel
http://www.dematte.at/tinyColorPicker/
MIT License
276 stars 77 forks source link

Change the color text from input field #46

Closed EltonSouza closed 8 years ago

EltonSouza commented 8 years ago

Hi, It can be possible to change font color intead of the background color in a input field?

PitPik commented 8 years ago

Hi @EltonSouza , Yes, ...

renderCallback: function($elm, toggled) {
    $elm.css({'color': $elm.val()});
}
EltonSouza commented 8 years ago

but, how do I locked the background of input field to does't chance together? And, how do I specify a single input field that will be changed?

PitPik commented 8 years ago

Let's say .special is the className of the input you want to treat special:

renderCallback: function($elm, toggled) {
    $elm.filter('.special').css({
        'color': $elm.val(),
        'background-color': 'white'
    });
}

or

doRender: false,
renderCallback: function($elm, toggled) {
    $elm.filter('.special').css({'color': $elm.val()});
}
EltonSouza commented 8 years ago

Almost perfect!

The first example is exacly what I need, but I would like to know if is it possible to apply doRender: false only in the elements with the classname .special?

Thanks!

PitPik commented 8 years ago

You're welcome ;) Next time though, please don't open issues on gitHub project if you need help developing something. Issues are meant for bugs or other issues... Use stackoverflow or something similar instead.

Thanks and good luck.

EltonSouza commented 8 years ago

Ok and I'm so sorry, I didn't know it, anyway thanks for the help, I'll post my issues in the Stack Overflow.