title: Switch/case with Color
body: <p>Quick and easy question:</p>
  
  <h2>How to make switch/case with lots of Colors.</h2>
  
  <p>What I can do is:</p>
  
  <pre><code>if(color == Color.Red)
      color = Color.Green;
  else
  {
      if(color == Color.Green)
          color = Color.Blue;
      else
      {
          // ...
      }
  }
  </code></pre>
  
  <p>or I can do a <code>Dictionary</code> with old/new color to replace them (in this specific example, there is no additional work needed apart from assigning a new color).</p>
  
  <p>or I can use tmp variable, so it become (but again, in this specific case):</p>
  
  <pre><code>Color tmp = Color.Transparent; // or whatever
  if(color == Color.Red)
      tmp = Color.Green;
  if(color == Color.Green)
      tmp = Color.Blue;
  //...
  color = tmp;
  </code></pre>
  
  <p>What I want is something like</p>
  
  <pre><code>switch(color)
  {
      case Color.Red:
          // ...
          break;
      case Color.Green:
          // ...
          break;
      case Color.Blue:
          // ...
          break;
  }
  </code></pre>
  
  <p>I found <a href="http://www.codeproject.com/Tips/183372/A-custom-switch-case-in-C" rel="nofollow">this</a> interesting article, which I may decide to use.</p>
  
  <p>Or I was thinking about something like</p>
  
  <pre><code>switch(color.ToArgb())
  {
      case 129381038: // Color.Red?? how to put it here nicely?
          // ...
  }
  </code></pre>
  
  <p>What you guys think is better?</p>