How do I make a Material Instanced in which I can make changes to color values of different parts of BaseColor Texture (With Material/Object ID Map help, which has several colors, more than 3)

Hello, I want to make a possibility to change color values in material instanced of different parts in one texture (Base Color). with material/object ID Map that has several different colors that which is responsible for different parts of base color texture.
I saw this ability in some videos, they can change the colors with MatID map help in Material Instanced editor. And they can change the color of many parts. I tried to find some articles about this, videos etc, but I really cant find some resources about exactly this way.