mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 05:16:34 +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) {
|
if (newVal.attributes.brightness) {
|
||||||
const brightness = newVal.attributes.brightness;
|
const brightness = newVal.attributes.brightness;
|
||||||
// lowest brighntess will be around 50% (that's pretty dark)
|
// 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);
|
Object.assign(this.$.icon.style, iconStyle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user