What is wrong with this syntax?

The last line always return “black”

          { "type": "text",  
            "value": a.w ~ "-" ~ a.g ~ " m/s", 
            "font": "ppb.ttf",
            "x": 2 + (75*ns.cnt),
            "y": 28, "size": 12,
            "color": "black" if a.w | int <= 7 or a.g |int <= 10 else "red"},

If I remove the or condition then it will return “red” when I sometimes want it.

there’s nothing wrong with the syntax. What are your expectations with this? if a.w <= 7 or a.g <= 10 the result will be ‘black’

The issue is that it generates this:

{
    "type": "text",
    "value": "7-14 m/s",
    "font": "ppb.ttf",
    "x": 77,
    "y": 86,
    "size": 12,
    "color": "black"
  },

Gah… I just realize my issue. I should reverse the syntax to be “red” if … “black”