title: Why change color to yellow not working with spriteRenderer programically in unity?
body: <p>I have a flower of which the petals are individually from the stalk:</p>
  
  <p><a href="https://i.stack.imgur.com/7qmjH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7qmjH.png" alt="enter image description here"></a></p>
  
  <p>I have no problem to change the petals to green or black with following script:</p>
  
  <pre><code>private void Start()
  {
      flower = transform.GetChild(transform.childCount - 1).gameObject;
      if (Random.Range(0, 1.0f) &lt; 0.5f)
      {
          for (int i = 0; i &lt; flower.transform.childCount; i++)
          {
              flower.transform.GetChild(i).gameObject.GetComponent&lt;SpriteRenderer&gt;().color = Color.green;// Color.yellow;
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/S9Mif.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S9Mif.png" alt="enter image description here"></a></p>
  
  <p>But what is weird is that the color will not change to yellow with this:</p>
  
  <pre><code>flower.transform.GetChild(i).gameObject.GetComponent&lt;SpriteRenderer&gt;().color = Color.yellow;
  </code></pre>
  
  <p>Note that, the <code>Random.range()</code> is not the problem. It just couldn't change to yellow/ or white, but colors such as <code>black</code>, <code>green</code> will be ok.</p>
  
  <p>And if you may forgive me to ask another question, is the color representation of <code>rgba</code> from <code>0-1</code> is that of in Photoshop representation 0-255 divided by 255?
  Such that a color <code>RGBA(255,255,1,255)</code> will be <code>Color(255/255.0, 255/255.0, 1/255.0, 255/255.0)</code> which will come to <code>Color(1.0f,1.0f,0.00001f, 1.0f)</code> in Unity?</p>
  
  <p>FYI, the attribute of the petals' spriteRenderer is as following, and I use the <code>Sprite-Default</code> material:
  <a href="https://i.stack.imgur.com/pfiRY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pfiRY.png" alt="enter image description here"></a></p>
  
  <h2>EDIT:</h2>
  
  <p>Add the raw sprite sheet as required by comment:</p>
  
  <p><a href="https://i.stack.imgur.com/8Gm8y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Gm8y.png" alt="enter image description here"></a></p>