title: How to change Text and Image color of button in Unity?
body: <p>I would love to change button color on click but have no idea how to access the color. I see that my button has component Image which includes that color however I am unable to access it. I have the same issue with button's text where I also didn't found a way how to access it.</p>
  
  <p>I have tried follow <a href="https://forum.unity.com/threads/how-to-change-button-sprite-and-text-color.324741/" rel="nofollow noreferrer">this</a> tutorial but I am getting error (more on screenshots).</p>
  
  <pre><code>using UnityEngine.UIElements;
  
  public class GameManager : MonoBehaviour {
  //...
   // This is my onclick function
   public void SelectLevel(int level ) {
    Debug.Log(level);
    GameObject btn = GameObject.Find("Btn" + level);
    Debug.Log(btn);
    Image imgButton = btn.GetComponent&lt;Image&gt;();
    Debug.Log(imgButton);
   }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Ic6Tz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ic6Tz.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/0MqNB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0MqNB.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/1HgIa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1HgIa.png" alt="enter image description here"></a></p>