|
|
|
@ -51,13 +51,15 @@ document.getElementById("range_dots").value= (getCookie("dotsAmount")!="" ? getC
|
|
|
|
|
output.innerHTML = (getCookie("dotsAmount")!="" ? getCookie("dotsAmount") : 4);
|
|
|
|
|
|
|
|
|
|
var customColorsAvailable=["#FF0000","#ffff00","#008000","#800080","#000000","#8b4513","#00ffff","#ffa500"];
|
|
|
|
|
// Simple example, see optional options for more configuration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var cpt=1;cpt<9;cpt++)
|
|
|
|
|
{
|
|
|
|
|
eval('pickr'+cpt+` = Pickr.create({
|
|
|
|
|
el: '.col`+cpt+`',
|
|
|
|
|
theme: 'monolith',
|
|
|
|
|
default: (getCookie("color_`+cpt+`")=="" ? customColorsAvailable[cpt-1] : getCookie("color_`+cpt+`")),
|
|
|
|
|
useAsButton: true,
|
|
|
|
|
|
|
|
|
|
components: {
|
|
|
|
|
|
|
|
|
@ -75,8 +77,10 @@ for(var cpt=1;cpt<9;cpt++)
|
|
|
|
|
}
|
|
|
|
|
});`);
|
|
|
|
|
|
|
|
|
|
eval("pickr"+cpt+`.on('save', function () {
|
|
|
|
|
console.log(pickr`+cpt+`.getColor().toHEXA().toString());
|
|
|
|
|
eval("pickr"+cpt+`.on('init', function() {
|
|
|
|
|
document.getElementById("col`+cpt+`").style.background=pickr`+cpt+`.getSelectedColor().toHEXA().toString();
|
|
|
|
|
}).on('save', function () {
|
|
|
|
|
document.getElementById("col`+cpt+`").style.background=pickr`+cpt+`.getColor().toHEXA().toString();
|
|
|
|
|
setCookie("color_`+cpt+`",pickr`+cpt+`.getColor().toHEXA().toString(),30);
|
|
|
|
|
pickr`+cpt+`.hide();
|
|
|
|
|
});`);
|
|
|
|
|