title: JAVA - Matrix color rings
body: <p>I need to show a matrix with color in a way that is like a rainbow. 
  I found the proper way to "paint" in a system.out. </p>
  
  <p>The matrix should be filled with "0". Those "0" are the ones which should have colours.</p>
  
  <p>But i ran out of ideas of how to implement the method that prints that rainbow.
  Here is an image of what I need:
  <a href="http://i.imgur.com/taulntW.png" rel="nofollow">http://i.imgur.com/taulntW.png</a></p>
  
  <p>Any idea?</p>
  
  <p>Thanks!</p>
  
  <p>PD:
  I managed to do this but with numbers which i think are more"visually friendly".
  This code will fill the matrix with numbers, the external ring would have "1", second ring will have "2", 3rd ring will have "3".... and so on.
  This is the code:</p>
  
  <pre><code>int counter = mat.length;
  
      for (int i = 0; i &lt; mat.length - 1; i++) {
          for (int j = i; j &lt; counter; j++) {
              for (int k = i; k &lt; counter; k++) {
  
                  mat[j][k] += 1;
              }
  
          }
          counter--;
  
      }
  </code></pre>