Dynamic badge color using variables from entity (without using classes)?

Is it possible to change the colour of a badge dynamically, not with a classes, but with a value taken from an entity? For example, there is an entity of priorities: Highest | db634f Critical | f3ae5e Alarming | eed648 Act Soon | 78ba5d Lowest | 3078ba I want it to change colour to the value in the second column depending on the priority taken to the badge in the first column. I wouldn't want to set the class, just retrieve this value dynamically from the entity. There is a 'Dynamic Style' widget but firstly I cannot change the colour (if it is not set according to widget style it always appears blue, even if I set the value 'color: #db634f' using the widget) and secondly perhaps there is another way without using class?
1 answers

Hi Marc,


Unfortunately, dynamic classes only works with predefined classes in your styling sheet.

Assuming the value colour value you want to use is on an entity, you could use the ‘HTML Widget With Context’-widget as an alternative