I want to change the color of game object, but when i am applying this script my object looks corrupted and this script also doesn't work.

var target : GameObject;

function Update(){
{ target.transform.renderer.material.color=Color.yellow; }
{target.transform.renderer.material.color=Color.grey; }

PS: please tell me how to convert RGBA into float to use my own color.

Color color= new Color(129 / 255f, 127 / 255f, 127 / 255f, 127 / 255f);