i believe the IF is the fastest, so for the slowness you cannot change the IF, you need to revise the variables being used. a marginal performance gain if any can be obtained if you replace the RGB() and Yellow with constant values.
I hope you are knowing what you are doing by using such monstrous expressions which contain only a mass of variables (variables are only useful if they simplify things). It must be a nightmare to develop and maintain it and it's no surprise that it is slow.
Beside this you could speed up your expression with a pick(match()) instead of an if-loop, for example with something like this: