change image color in unity code example

Example 1: how to change a image with code unity

// Change From GameOject
public GameObject GameObjectWithImage;
public Sprite ImageYouWant;
GameObjectWithImage.GetComponent<Image>().sprite = ImageYouWant

// Change From Image
public Image Image;
public Sprite ImageYouWant;
Image.sprite = ImageYouWant

Example 2: how to change image color unity

using UnityEngine.UI;

public GameObject YourgameObjectWithImage;
YourgameObjectWithImage.GetComponent<Image>().color = new Color32(255, 255, 225, 225);