how to change color of a sprite in unity code example
Example 1: how to change color of a sprite in unity
//option 1
GetComponent<spriteRenderer>().color = Color.red
//option 2
sprite.color = new Color (R, G, B, A);
Example 2: change sprite color unity
sprite.color = new Color (1, 0, 0, 1);