custom-cards / bar-card

Customizable Animated Bar card for Home Assistant Lovelace
MIT License
378 stars 54 forks source link

[Feature Request] Dynamic colors #112

Open Imperial-Guard opened 3 years ago

Imperial-Guard commented 3 years ago

Currently colors are set static as a string is there a possibility to make those dynamic via for e.g. a input_number or like the flower-card via data.js

xuefer commented 3 years ago

I'm too looking for flower-card like temperature & humidity bar or meter card. target value is a range instead of a single point value, the visual make it easier to see how close to or far from lower/upper bound of target (comfort) range

luixal commented 2 years ago

Hi,

If you're looking for changing severity colors, this worked for me:

severity:
      - color: Red
        from: 0
        to: 20
      - color: Orange
        from: 21
        to: 50
      - color: "#ff00aa"
        from: 51
        to: 100

Putting the color between quotes (single: ' or double: ") is mandatory.

Cheers!