how to change font color code of Text UI in unity in script 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;