mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 13:27:22 +00:00
Safer brightness calculation for icons
This commit is contained in:
parent
d97e356376
commit
1eb4ac7f34
@ -89,7 +89,7 @@ class StateBadge extends PolymerElement {
|
||||
if (newVal.attributes.brightness) {
|
||||
const brightness = newVal.attributes.brightness;
|
||||
// lowest brighntess will be around 50% (that's pretty dark)
|
||||
iconStyle.filter = `brightness(${(brightness + 245) / 5}%)`;
|
||||
iconStyle.filter = `brightness(${(parseInt(brightness) + 245) / 5}%)`;
|
||||
}
|
||||
}
|
||||
Object.assign(this.$.icon.style, iconStyle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user