picker starts withthe right color

This commit is contained in:
JFH
2021-01-01 12:35:16 +01:00
parent 9c0dedb89a
commit 7e33ea2bdc
2 changed files with 6 additions and 5 deletions

View File

@@ -6,15 +6,13 @@ class PaintBox {
/**
* @param {string|Element|external:jQuery} container
* @param {"fill"} type
* @param {string} color
* @param {number} opacity
*/
constructor (container, type, color, opacity) {
constructor (container, type) {
// set up gradients to be used for the buttons
const svgdocbox = new DOMParser().parseFromString(
`<svg xmlns="http://www.w3.org/2000/svg">
<rect
fill="#${color}" opacity="${opacity}" width="22" height="22"/>
fill="#000000" opacity="1" width="22" height="22"/>
<defs><linearGradient id="gradbox_${PaintBox.ctr++}"/></defs>
</svg>`,
'text/xml'
@@ -26,7 +24,7 @@ class PaintBox {
this.rect = docElem.firstElementChild;
this.defs = docElem.getElementsByTagName('defs')[0];
this.grad = this.defs.firstElementChild;
this.paint = new $.jGraduate.Paint({solidColor: color});
// this.paint = new $.jGraduate.Paint({solidColor: color});
this.type = type;
}