I would do some combination of multiplication and if nodes. Multiply R * G for example, and that value will be zero for everything except Yellow and White. This assumes all of your values are either fully off or fully on - this strategy won’t work for the orange color in that map, since it’s (1,0.5,0), so I’d use an if node to separate out those 0.5 values.