// To change the color of a text, see below
GameObject.GetComponent<Text>().color = Color.black;
//will change the color of the text to red (RGB)
TextGameObject.color = new Color(255, 0, 0);
//will change the color of the text to red with alpha channel (RGBA)
TextGameObject.color = new Color32(255, 0, 0, 0);