I've got a working jquery code snippet that gets the hex value of my color picker farbtastic just fine. Problem I am having is taking that and applying it as a tint with paintbrushjs. The Hex just does not transfer over to the id of the image and does not update the data-tint-pb-colour option. So I am possibly looking at a php option but would like input first on a possible fix as I've worked on this 3 days now and unable to get it to work.
JAVASCRIPT/JQUERY
$(document).ready(function() {
$('#demo').hide();
$('#picker').farbtastic('#color');
});
$(document).ready(function() {
var picker = $.farbtastic('#picker');
picker.linkTo(function onColorChange(color) {
$('filter-tint').attr('data-pb-tint-colour',color)
console.log(color, "hello world!");
});
});
HTML
<form action="" style="width: 400px;">
<div class="form-item"><label for="color">Color:</label><input type="text" id="color" name="color" value="#123456" /></div><div id="picker"></div>
</form>
<img id="filter-tint" class="filter-tint" src="http://preview.88kcikfcuw4mfgvi8ckrxvjrndu6jemi01t025rhda6skyb9.box.codeanywhere.com/images/Layer2.png" data-pb-tint-opacity="0" data-pb-tint-colour="#ffffff"/>
I've basically hit a wall. Not sure how to make this work. fiddle.