mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Safer brightness calculation for icons
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user