title: Choosing a color from an array of them just returns black?
body: <p>Here's my situation.  I'm using Processing 2.0, and I'm trying to make a grid of squares turned at a 45-degree angle.  Each square will be filled with a color chosen randomly from a palette of five.  My problem is this; for some reason, when I use <code>COLORS[int(random(COLORS.length))]</code> to get a color from my palette, I only get black!  It's doubly weird because black is not one of the colors in my palette!  I have tested my <code>floodFill()</code> function, and I can confirm that it works, as testing with a single color <em>not</em> pulled from an array works all right.  Any tips?  My code is as follows:</p>
  
  <pre><code>final int DX = 16, DY = DX;
  final color DEFAULT_BG = color(50, 50, 50);
  final color[] COLORS = {
    color(#ff3333),
    color(#4fff55),
    color(#585eff),
    color(#ebff55),
    color(#FF55D5),
  };
  
  void setup() {
    size(800, 480);
    background(DEFAULT_BG);
    noSmooth();
    for (int x = 0; x &lt; width; x += DX) {
      for (int y = 0; y &lt; height; y += DY) {
        line(x, y, x + 16, y + 16);
        line(x + 16, y, x, y + 16);
      }
    }
  
    for (int x = 0; x &lt; width; x += 4) {
      for (int y = 0; y &lt; height; y += 4) {
        if (get(x, y) == DEFAULT_BG) {
          color f = COLORS[int(random(COLORS.length))];
          floodFill(x, y, DEFAULT_BG, color(f));
        }
      }
    }
  }
  
  void floodFill(final int x, final int y, final color from, final color to) {
    if (!(x &lt; 0 || y &lt; 0 || x &gt;= width || y &gt;= height || from == to || get(x, y) != from)) {
      set(x, y, to);
      floodFill(x, y + 1, from, to);
      floodFill(x, y - 1, from, to);
      floodFill(x + 1, y, from, to);
      floodFill(x - 1, y, from, to);
    }
  }
  </code></pre>
  
  <p>When I replace the <code>#rrggbb</code> notation with <code>0xrrggbb</code>, I get white instead.  When I replace it with <code>0xrrggbbaa</code>, I get black and white (not grayscale).</p>
  
  <p>Now using the standard <code>color(r, g, b)</code> notation works fine.  However, I'd still like to know what breaks the hexadecimal versions, so I'll leave this question open.</p>