How to change GUI Text color in a javascript?

I have a game where there is GUI text, then I want the text to change colors when a certain action is performed. I put a mesh renderer on the text and tried renderer.material.color = Color.white, but that did not work.

Documentation is a good place to start looking.