Is there a way to assign materials based on a color map in blender?
You may be able to use mix shader nodes

I achieved this result;




Using this node setup;



And these black and white textures (painted in blender, directly on the object);



.blend file here;



Effectively, what this does is uses the black (0) and white (1) or gray (some decimal value in between) as a factor for a mix shader. This mixing can be added to as many times as you like with this setup.