diff --git a/bar-card.js b/bar-card.js index 6af4e82..4d50a02 100644 --- a/bar-card.js +++ b/bar-card.js @@ -583,7 +583,7 @@ class BarCard extends HTMLElement { sections.forEach(section => { if (numberValue <= section.value && !color) { const keys = Object.keys(section) - if (keys[1] == 'color') color = section.color + if (keys[0] == 'color' || keys[1] == 'color') color = section.color else color = 'hsl(' + section.hue + ',50%,50%)' } }) @@ -1031,4 +1031,4 @@ class BarCard extends HTMLElement { } } -customElements.define('bar-card', BarCard) \ No newline at end of file +customElements.define('bar-card', BarCard)