{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "padding-left": "14px"
  },
  "attributes": {
    "class": {
      "operator": "+",
      "operands": [
        {
          "operator": "?",
          "operands": [
            {
              "operator": "==",
              "operands": [
                "@currentField",
                "Red"
              ]
            },
            "ms-bgColor-red",
            {
              "operator": "?",
              "operands": [
                {
                  "operator": "==",
                  "operands": [
                    "@currentField",
                    "Green"
                  ]
                },
                "ms-bgColor-green",
                {
                  "operator": "?",
                  "operands": [
                    {
                      "operator": "==",
                      "operands": [
                        "@currentField",
                        "Amber"
                      ]
                    },
                    "ms-bgColor-orangeLighter",
                    {
                      "operator": "?",
                      "operands": [
                        {
                          "operator": "==",
                          "operands": [
                            "@currentField",
                            "Yellow"
                          ]
                        },
                        "ms-bgColor-yellow",
                        ""
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        " ms-fontColor-white"
      ]
    }
  }
}