How do i use multi color id map with my layered materials?

Say as example i have my baked id map like the image below. for the life of me i cant find anywhere online where someone is using this type of setup with layered materials. i see plenty of examples of masking with rgb masking. however almost everything i do has far more masks like the image below. can someone tell me how i can … i guess color pick from my mask image and use that as a mask in unreal? i just cant find any good info on setting up my mask using an image like below.

i use substance painter and designer, i’d like to do something similar for my masking.

cheers. really appreciate any help on this.

apologies, the image wasnt working beforel

Well, it’s more complicated than usual RGBA mask with lerp and there are multiple ways to deal with it.
If you have more than 3 and less then 13 colors then this solution might help you. It based on R,G,B, R-B,R-G and et cetera. Easy to implement, easy to use and you rarely need more than 13 id’s anyway.
If you want to have more control and “pick ID by any color”-type of workflow then check out this thread buuut it’s more complicated than it should be IMHO.