Light automation for hue bulbs gives colour error

I use the following automation to turn light on/off automatically with a motion sensor & was looking to add “colour” notifications for weather alerts - but I get the following error logged:

Got unknown color “white”, falling back to white

Here is the automation:

- alias: "hallway motion on"
  initial_state: "on"
  trigger:
    - platform: state
      entity_id: binary_sensor.fibaro_system_fgms001zw5_motion_sensor_sensor
      to: 'on'
  condition:
    - condition: state
      entity_id: light.hallway
      state: 'off'
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.hallway
        brightness_pct: >
          {%- if now().strftime('%H')| int >= 22 %}
            50
          {%- elif now().strftime('%H')| int < 7 %}
            30
          {%- elif now().strftime('%H')| int >= 7 %}
            100
          {%- endif %}
        transition: 3
        color_name: >
          {% if is_state('sensor.dark_sky_precip', 'rain') %}      
            "blue"
          {% else %}
            "white"
          {% endif %}
    - service: input_boolean.turn_on
      entity_id: input_boolean.motion_auto_on

Any ideas?

Remove the quotes from around the colour names.

        color_name: >
          {% if is_state('sensor.dark_sky_precip', 'rain') %}      
            blue
          {% else %}
            white
          {% endif %}

tried that but still get the same error, with any of the following combos:

white

“white”

‘white’

Is white a colour?

What happens if you replace it with ‘orange’?

EDIT, apparently it is: https://www.w3.org/TR/css-color-3/#svg-color

Are you sure you restarted after removing the quotes? It definitely should work as @tom_l suggests.

BTW, you can also simplify the brightness_pct template a bit, too. I.e., you can change:

now().strftime('%H')| int >= 22

to:

now().hour >= 22

etc.