title: Change the color of SpriteRenderer in Unity3d
body: <p>I have this method that picks a random color from a preset array of colors.</p>
  
  <pre><code> public Color GetRandomColor()
   {
       return colors[rand.Next(0, colors.Length)];               
   }
  </code></pre>
  
  <p>Then I use it in this method in another class</p>
  
  <pre><code>public void RandomizeColors()
  {
      for(int i = 0; i&lt; spriteRenderers.Length; i++)
      {    
          spriteRenderers[i].color = rColors.GetRandomColor();
      }
  }
  </code></pre>
  
  <p>The problem is that the colors of the sprite renderers all get set to some strange values. The RGB gets set to something in the thousands.</p>
  
  <p>if I use <code>spriteRenderers[i].color = Color.black</code> for example it works fine.</p>
  
  <p>I have checked the return values of <code>GetRandomColor()</code> and they are all correct. Where am I doing this wrong ?</p>
  
  <p><strong>Edit:</strong> 
  The array of colors. This is part of a constructor:  </p>
  
  <pre><code>colors = new Color[7];
  colors[0] = new Color(87f,72f,161f) ;
  colors[1] = new Color(39f,145f,221f);
  colors[2] = new Color(233f,191f,57f);
  colors[3] = new Color(238f,133f,57f);
  colors[4] = new Color(238f,71f,46f);
  colors[5] = new Color(193f,57f,235f);
  colors[6] = new Color(104f,176f,58f);
  </code></pre>