mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
24 lines
656 B
JavaScript
24 lines
656 B
JavaScript
|
|
//format a color button
|
|
function initColor (colorElement) {
|
|
//console.log('initColor()');
|
|
//console.log(document.getElementById('jscolor-hex-input'))
|
|
|
|
|
|
//add jscolor picker for this color
|
|
colorElement.jscolor = new jscolor(colorElement.parentElement, {
|
|
valueElement: null, //if you dont set this to null, it turns the button (colorElement) into text, we set it when you open the picker
|
|
styleElement: colorElement,
|
|
width:151,
|
|
position: 'left',
|
|
padding:0,
|
|
borderWidth:14,
|
|
borderColor: '#332f35',
|
|
backgroundColor: '#332f35',
|
|
insetColor: 'transparent',
|
|
value: colorElement.style.backgroundColor,
|
|
deleteButton: true,
|
|
});
|
|
|
|
}
|