foreach list gameobject random color

good guys days, I have a problem understanding on how I use the foreach loop and a list of gameobjects, expose the doubt with the following code.

Renderer rChunk;
List list = new List();
//since prefab i want to randomice the color material
foreach(Gameobject g in list){
rChunk = g.GetComponent();
rChunk.sharedMaterial.color = new Color(Random.Range(0.0f,1.0f),Random.Range(0.0f,1.0f),Random.Range(0.0f,1.0f));

}

okk, the problem is, i have always the same color, never is calculated a new color in each iteration, why?

Insead of rChunk.sharedMaterial use rChunk.material.