A "glance" that shows one identity but changes color to reflect a second identity

I need to display a temperature value and at the same time change the color based on a “light” sensor.

to understand each other

type: glance
entities:
  - entity: light.sth001
    color grey if "sensor.th_001_temperature ==off"
    color green if "sensor.th_001_temperature ==on"

I couldn’t find anything online but I remember that I made something like this in the past with mod-card but I REMEMBER

- entity: sensor.th_001_temperature
    card_mod:
      style: |
        :host {
          --card-mod-icon-color:
          {% if states(light.sth001) == 'off' %}
             red
          {% endif %}
            green
        }
        

Change to

{% if states('light.sth001') == 'off' -%}
  red;
{%- else -%}
  green;
{%- endif %}

or to

... is_state('light.sth001','off') ...