using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class setColor : MonoBehaviour
{
SpriteRenderer sprite;
//this will easilly make u choose the color u want
public Color newColor;
void Start()
{
sprite = GetComponentInChildren<SpriteRenderer>();
sprite.color = newColor;
}
}
//option 1
GetComponent<spriteRenderer>().color = Color.red
//option 2
sprite.color = new Color (R, G, B, A);
sprite.color = new Color (1, 0, 0, 1);