Markdown Card: Random font color for each item?

I am using a Markdown Card to display a list of the state attributes of a card. It ranges from 0 items to 20. Can I have each item listed be a different random color?

Here it is with a single color for all items:
Screen Shot 2023-02-08 at 7.01.13 AM

      type: markdown
      content: >
        <font color = purple>{{ state_attr("climate.thermostat", "hvac_modes") |
        default([], True) | join(' ') }} </font>
type: markdown
content: >-
  {%- macro get_color() -%}
  {{ ['aqua', 'purple', 'darkcyan', 'plum', 'red', 'green', 'fuchsia', 'gold', 'limegreen', 'blue'] | random }}
  {%- endmacro -%}
  {%- for x in state_attr('climate.thermostat', 'hvac_modes') | default([], True) -%}
  <font color = {{get_color()}}>{{x}} &nbsp;</font>
  {%- endfor -%}

Screenshot_20230208-094816~2

3 Likes