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