title: Colors from RGB are not correct Unity C#
body: <p>So I have a 2D object that you can change the color of using buttons, and each button will change the sprite of the object. I have a sprite for red, orange, yellow, green, blue, purple.</p>
  
  <p>Now I have a particle system (A child of the object stated before) that I want to change the startColor property of to the same color as whatever the 2D object's sprite is. I'm using this code (Attached to the 2D object that you can change the sprite of):</p>
  
  <pre><code>        var sprite = gameObject.GetComponent&lt;SpriteRenderer&gt;().sprite;
          var startColor = gameObject.transform.GetChild(0).gameObject.GetComponent&lt;ParticleSystem&gt;().startColor;
  
          if (sprite == red) startColor = new Color(255, 29, 0);
          else if (sprite == orange) startColor = new Color(254, 32, 0);
          else if (sprite == yellow) startColor = new Color(254, 215, 0);
          else if (sprite == green) startColor = new Color(0, 254, 32);
          else if (sprite == blue) startColor = new Color(0, 37, 254);
          else if (sprite == purple) startColor = new Color(178, 0, 255);
  
          gameObject.transform.GetChild(0).gameObject.GetComponent&lt;ParticleSystem&gt;().startColor = startColor;
  </code></pre>
  
  <p>All the new Colors() I'm trying to create from RGB. So I took the RGB value of the all color sprites and plugged them in. And when I executed the code, the color of the particles doesn't match the object's sprite color.</p>
  
  <p>NOTES: I'm running this on android, and the material for the particle system is plain white so it shouldn't tint the color.</p>
  
  <p>I put the RGB values from the color sprites in over five times. But it doesn't match the sprites! I don't know what's wrong... if you need me to attach the color sprite images, just ask.</p>