or create a dedicated template sensor in HA, and use the state of that sensor entity.
that way you can easily use it everywhere you want to have that same color (eg in card-mod)
it’s by far the easiest way to do things like this, without blowing those configs out of proportion
example Is it possible to change header card icon based on entity state? - #10 by Mariusthvdb
check volgende_afval_kleur