Mushroom chips card - changing icon colour depending on state

The type of chip card matters, but here is an example and this is the link to the Mushroom thread

image

type: custom:mushroom-chips-card
chips:
  - type: template
    entity: light.pc_lights
    icon: mdi:mushroom
    icon_color: |
      {{ 'red' if states(config.entity) == 'on' else 'green'}}
    content: |
      {{ 'RED' if states(config.entity) == 'on' else 'GREEN'}}