title: pass an array to a function
body: <p>In processing, lets say I have an array:</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>int[] rgb = {floor(random(0,255)), floor(random(0,255)), floor(random(0,255)};
  </code></pre>
  
  <p>So this will create an array with [0], [1], and [2] being corresponding red, green. and blue values.</p>
  
  <p>Now let's say that I want to pass the <code>fill()</code> function, which needs 3 integers--red, green, and blue. I could just put <code>fill(rgb[0], rgb[1], rgb[2]);</code>, but that does not seem like the most efficient way of doing this. What I want is to be able to pass something like this to <code>fill()</code>:</p>
  
  <p><code>fill(rgb[0,1,2]);</code> which will do the same thing as <code>fill(rgb[0], rgb[1], rgb[2]);</code>, but will be much less writing. Help is appreciated.</p>