added color style property

This commit is contained in:
PMKuipers 2023-07-17 20:20:25 +02:00
parent d12df1d637
commit 886a244520

View File

@ -141,6 +141,7 @@ export class SimpleLine {
this.specs = { this.specs = {
autorefresh: 10, autorefresh: 10,
class: "", class: "",
color: "", // invalid propery makes it inherit from parent containers
anchors: { anchors: {
// top, middle, bottom // top, middle, bottom
// left, center, right // left, center, right
@ -364,6 +365,7 @@ export class SimpleLine {
this.svg.setAttribute("viewBox",`0 0 ${bounds.w}, ${bounds.h}`); this.svg.setAttribute("viewBox",`0 0 ${bounds.w}, ${bounds.h}`);
this.svg.setAttribute("width",`${bounds.w}px`); this.svg.setAttribute("width",`${bounds.w}px`);
this.svg.setAttribute("height",`${bounds.h}px`); this.svg.setAttribute("height",`${bounds.h}px`);
this.svg.style.color = this.specs.color;
// Reposition the SVG relative to the container // Reposition the SVG relative to the container
this.svg.style.left = `${bounds.x}px`; this.svg.style.left = `${bounds.x}px`;