Variable colours for entity badges

Currently when creating an entity badge on our dashboard we can select a colour, but could it be added so the colour could be variable using logic to decide what colour.
E.g. If state is x then Blue, if y then green, if z then red.
Or if state is < x then Blue, if > y then red, else white etc