if("canvasFill" in this){ if("canvasFillImage" in this){ this.canvasFill = ctx.createPattern(this.canvasFillImage, "repeat"); delete this.canvasFillImage; } ctx.fillStyle = this.canvasFill; if(apply){ ctx.fill(); } }else{ ctx.fillStyle = "rgba(0,0,0,0.0)"; }