Icon color - hs_color attribute works only for state = 'on'

In customize_glob.yaml I have code to change icon and color for switches.
Icon works correctly, but color change only for “on” state, for off I have default blue color, why ?

switch.out*:
  templates:
    icon: >
      if (state === 'on')  return 'mdi:toggle-switch';
      else return 'mdi:toggle-switch-off';
    hs_color: >
      if (state === 'on') return [58, 87, 47];
      else return [353,65,45];

Just as a test, what happens if you reverse the if.
So if === off …
Else …

EDIT:
I looked at my own config and I use icon_color: if... return 'rgb(10,10,10)'

Thank you for help, it was problem with version 110 https://community.home-assistant.io/t/customui-icon-color-stopped-working-after-version-110/198553