how to change font color of Text UI in unity in script by colorcode code example
Example: unity change text color
// To change the color of a text, see below
GameObject.GetComponent<Text>().color = Color.black;
// To change the color of a text, see below
GameObject.GetComponent<Text>().color = Color.black;