Icon color help with if statement

Good morning all,
I’m using the mushroom cards for my dashboard, and I’m trying to figure out how to set the color of the icon based upon the position of my window covers. I was previously able to do this based upon the window covering being a binary switch and multi level switch, which worked fine with the Mushroom Cover card, however, the product has been migrated to the Window Covering device class, which isn’t playing nicely with Mushroom Covers or Tiles.

Previously, I was simply able to compare the state to on or off. If it was on, I chose blue, and if it was off, it defaulted to grey.

    icon_color: |-
      {% if is_state('switch.mud_room_blind', 'on') %}
        blue
      {% endif %}

Now, I have to compare the state_attr of the current_tilt_position to see if it’s in one of two closed positions ( 0 or 100) for grey or default, and anything in between should be open, or blue. This is what I’ve come up with, and it’s not changing the color when the blinds are open.

    icon_color: |-
      {% if state_attr('cover.mia_s_room_blind_left_horizontal_slats_angle',
      'current_tilt_position') == 100  %}
        grey
      {% elif state_attr('cover.mia_s_room_blind_left_horizontal_slats_angle',
      'current_tilt_position') == 0  %}
        grey
      {% else %}}
        blue
      {% endif %}

I thought I might be able to simplify it by using a not equals, which does work, but I can’t get it to work by comparing two values. Is there a way to do an OR in this sort of statement in a single line, i.e., not eq to 0 or 100?

    icon_color: |-
      {% if state_attr('cover.office_blind_right_horizontal_slats_angle',
      'current_tilt_position') != 100 %}
        blue
      {% endif %}

Hello Tim, try

icon_color: >
  {% set c = state_attr('cover.mia_s_room_blind_left_horizontal_slats_angle', 'current_tilt_position') |int(0) %}
  {{ 'blue' if 100 > c > 0 else 'grey' }}

@Pedolsky, nice that works! Thanks!