Color submeshes

I have a mesh that has 10 submeshes, I wonder how I can change the color of of these submeshes to a different color (e.g submesh1 will have a red color, submesh2 will have a blue color,…etc). Any advise please?

UPDATE:

This is how I’m getting my mesh which has 10 submeshes:

SkinnedMeshRenderer smr = gameobject1.GetComponent();
Mesh main_mesh = smr.sharedMesh;

GetComponent<MeshRenderer>().materials[0].colour = new Color.red;

could you please check my updated question, I showed how I got my mesh.