title: How To Print String representation of Color in Java
body: <p>I have an array of colours of size n. In my program, the number of teams is always &lt;= n, and I need to assign each team a unique color. This is my color array:</p>
  
  <pre><code>private static Color[] TEAM_COLORS = {Color.BLUE, Color.RED, Color.CYAN, Color.GREEN, Color.ORANGE, Color.PINK};
  </code></pre>
  
  <p>When I print information about the players in the console, I want to print what color is associated with them. When I print the color, I get </p>
  
  <pre><code>java.awt.Color[r=...,g=...,b=...]. 
  </code></pre>
  
  <p>I understand that this is how Java prints colours. I was wondering if there was a way to instead print BLUE, RED, etc. (so the pre-defined color string).</p>