text: How would one go about doing that? My method did not work.
  Image img = transform.Find("UpgradeCanvas/Speed/First").GetComponent<Image>().color = Color.blue;
  It says it could not convert Unity.Color to Unity.UI.Image, but I am otherwise unsure of how to change this via script.
  I can't believe I did that. Okay, so now I moved it down to img.color = color.red; but that still isn't actually changing the color. Any idea why?
  test it :
  Component img= transform.Find("UpgradeCanvas/Speed/First").GetComponent<Image>();
  img.color = Color.blue;
  is "UpgradeCanvas/Speed/First" a game object name ? :-?
  It should be Image img, not component. It exists, so I don't know why it didn't work. I changed it to a public variable and just dragged it in, and now it works.
  Answer by code_warrior
  ·
  Jan 01, 2015 at 12:53 PM
  Hi Marshal_Alessi,
  I've just checked out your question in a real simply Unity Scene, I had one UI Panel Called MyPanel.
  The working C# script:
  using UnityEngine;
  using UnityEngine.UI;
  using System.Collections;
  public class ChangePanel : MonoBehaviour {
  // Use this for initialization
  void Start () {
  Image img = GameObject.Find("MyPanel").GetComponent<Image>();
  img.color = UnityEngine.Color.red;
  }
  }
  If you assign the script directly to your Panel you don't need the GameObject.Find() Method, simply call the GetComponent function.
  All you now have to do is to change the color and the name of your object.
  Please note: Its essential to do the GetComponent and the process of assigning a color in two separate lines.
  code_warrior
  Answer by DevsGoingViral
  ·
  Jun 15, 2015 at 06:09 PM
  Working js script if someone need:
  #pragma strict
  import UnityEngine;
  import System.Collections;
  import UnityEngine.UI;
  ///////////////////////
  var imgObj : GameObject; //drag your Canvas here
  var img : Image = imgObj.GetComponent.<Image>(); //drag your image here
  function Start () {}
  function Update () {
  img.color = Color.red; //instant change
  }
  Answer by Jivibounty
  ·
  Nov 24, 2018 at 11:36 PM
  Your code assigns color to image. Hence cannot assign Unity.Color to Unity.UI.Image. That is the problem. remove "Image img =" .
  THE CODE SHOULD BE
  transform.Find("UpgradeCanvas/Speed/First").GetComponent().color = Color.blue;
  AND NOT
  Image img = transform.Find("UpgradeCanvas/Speed/First").GetComponent().color = Color.blue;
  Look at the other answers. Green means the asker marked it as correct. It's more like what the person was asking. What you wrote could be a comment on that answer about doing it in one step instead of.
  Problem with Swap Image in Unity 5 with C#.
  2
  Answers
  Change Canvas Image from Another Script
  1
  Answer
  Scaling an image sent to UI Image
  0
  Answers
  Canvas does not disable or enable? unity 5
  2
  Answers
  2D circular image carousel help!!!
  0
  Answers