title: Unity Color Extension Method not Affecting Color
body: <p>I want to change the alpha value of an existing color. However, I cannot directly edit the color. </p>
  
  <p>When I try something like this: </p>
  
  <pre><code>gui.color.a = 0;
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Error: Cannot modify the return value of 'UnityEngine.GUITexture.color'
    because it is not a variable.</p>
  </blockquote>
  
  <p>But if I copy the variable I am able to edit the alpha value.</p>
  
  <pre><code>Color tempColor = gui.color;
  tempColor .a = .25f;
  gui.color = tmpclr;
  </code></pre>
  
  <p>Why is this? Why is the new instance of the Color not throwing the same error?</p>
  
  <p>Additionally, I thought that because I had to do this often I would write a little extension method like this:</p>
  
  <pre><code>private static Color tempColor;
  public static void SetAlpha(this Color color, float alpha)
  {
      tempColor = color;
      tempColor.a = alpha;
      color = tempColor;
  }
  </code></pre>
  
  <p>But to my surprise this compiled but didn't change the alpha value at all. Can anyone explain why this might not be working?</p>