Check this example:
In a blank Canvas App:
1) Place a Text input field
2) Place an Icon (Circle Icon in this example)
On the Fill Attribute of the Icon, place this Formula:
If(TextInput1.Text = "1",Red, If(TextInput1.Text = "2",Green, If(TextInput1.Text = "3",Blue, If(TextInput1.Text = "4",Yellow))))
3) Try the app and change value to 1, 2, 3, 4 and it works to change to 4 different colors based on the nested If Formula.

See if you can adapt above simple example to your scenario.