how to set color in hex value unity code example
Example 1: unity change text color
// To change the color of a text, see below
GameObject.GetComponent<Text>().color = Color.black;
Example 2: unity set material color
//Gets the renderer material and sets color
object.GetComponent<Renderer>().material.color = newColor;