Certain icons can color others cannot?

I have several icons on my dashboard that I have colored either via the UI or via dynamic templates, while others, even though I have configured the UI to add a color, still show as gray. Are there some icons that do not accept color?

Examples:
image

The battery and the calendar icons will accept color, the alarm-bell and molecule-co will not accept color.

What are the card types? Entities, Tile, Mushroom or something else?

It may be helpful to provide the code for a card that does not have color…

All mushroom entity cards. All configured through the UI. The only difference is the mdi icons that are selected.

Check out these threads here and here.

If you are still having issues, post in either referenced threads and I will assist you further.

Thanks. Further experimentation shows me that I’m not able to change the icon color in mushroom entity cards with binary entities. It works with sensor entities and most others it seems. Does this make any sense?

Two options…

  1. Switch to the Mushroom Template card

  2. Install HACs and use the plugin card_mod then the possibilities are endless.

Template Examples

type: custom:mushroom-template-card
primary: Primary text
secondary: Secondary text
icon: mdi:mushroom
entity: sensor.xxxx
icon_color: red
type: custom:mushroom-template-card
entity: light.night_stand
primary: Primary text
secondary: Secondary text
icon: mdi:lamp
icon_color: |
  {% if states(config.entity) == 'off' %} 
      red
       {% else %}
      green
    {% endif %}

Thank you, the mushroom-template-card worked fine for me. I guess I didn’t understand that some entity icons could be colored with the regular mushroom-entity card and others could not.