Hi,
You can use a Color Key effect, key the colour you want, then apply an Invert to the alpha channel and that’s it, you’ve keyed out everything but the matte you need.
Then, of course, you need to repeat this for every ID colour.
Oscarh,
animation student