04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

also makes the code a little harder to read. I tried to find a balance in the example, using<br />

a minimal amount of hard-coded magic numbers, or specific values put directly into the<br />

code. As mentioned previously, magic numbers are generally to be avoided.<br />

//temporarily set colorMode to HSB<br />

colorMode(HSB, 6, 26, 26);<br />

//construct palette values<br />

int paletteCounter = 0;<br />

for (int j=0; j0; i--){<br />

if (i>13){<br />

palette[paletteCounter] = color(r<strong>and</strong>om(6), r<strong>and</strong>om(26)+5, ➥<br />

r<strong>and</strong>om(26)+5);<br />

}<br />

if (i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!