How to access color on material

So, in my game I’m spawning a lot of creatures. I want all of them to have a unique color value to separate them from each other. I ran across this script

which I think could help me by modifying the color property of each game object spawned. But when I tried to use it I couldn’t find the color property in material, I tried giving it a lot of different shaders but none of them seem to have the _Color property.

So I guess my question would be, how do you get to the color property of a material?

Here’s how the code looks so far. It runs, but it can’t find the color property.

HSVColor randomHSV = new HSVColor();
HSVColor.FromColor(clone.renderer.material.color);

//Set value here
			
clone.renderer.material.color = HSVColor.ToColor(randomHSV);

As you found out, some shaders have a color property, but many do not…and it is up to the shader how that color is used when it exists. Your code above will work when there is a _Color property. The default/standard diffuse has a color property. A better question might be to spell out what you want in a shader. You will find some shaders here:

http://wiki.unity3d.com/index.php/Shaders