diff --git a/src/components/entity/state-badge.js b/src/components/entity/state-badge.js index 53ad82d2e0..a4058545d7 100644 --- a/src/components/entity/state-badge.js +++ b/src/components/entity/state-badge.js @@ -16,9 +16,11 @@ export default new Polymer({ * Called when an attribute changes that influences the color of the icon. */ updateIconColor(newVal) { - // for domain light, set color of icon to light color if available + // for domain light, set color of icon to light color if available and it is + // not very white (sum rgb colors < 730) if (newVal.domain === 'light' && newVal.state === 'on' && - newVal.attributes.rgb_color) { + newVal.attributes.rgb_color && + newVal.attributes.rgb_color.reduce((cur, tot) => cur + tot, 0) < 730) { this.$.icon.style.color = 'rgb(' + newVal.attributes.rgb_color.join(',') + ')'; } else { this.$.icon.style.color = null;