JSFiddle - React, Tailwind, and code Playground
by hollanditkzn
HTML
<input type="text" id="colorTextKons" name="colorTextKons">
JavaScript
$(document).ready(function(){
$('#colorTextKons').ColorPicker({
onSubmit: function(hsb, hex, rgb) {
$('#colorTextKons').val(hex);
},
onBeforeShow: function () {
$(this).ColorPickerSetColor(this.value);
}
})
.bind('keyup', function(){
$(this).ColorPickerSetColor(this.value);
});
$("#colorTextKons").on("input", function(){
ctx.fillStyle = "#"+$(this).val();
});
})