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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

416<br />

// Color Modes RGB/HSB<br />

size(400, 114);<br />

smooth();<br />

color red1 = color(255, 0, 0);<br />

color orange1 = color(255, 127, 0);<br />

color yellow1 = color(255, 255, 0);<br />

color green1 = color(0, 255, 0);<br />

color cyan1 = color(0, 255, 255);<br />

color blue1 = color(0, 0, 255);<br />

color purple1 = color(255, 0, 255);<br />

colorMode(HSB);<br />

color red2 = color(0, 255, 255);<br />

color orange2 = color(21.25, 255, 255);<br />

color yellow2 = color(42.5, 255, 255);<br />

color green2 = color(85, 255, 255);<br />

color cyan2 = color(127.5, 255, 255);<br />

color blue2 = color(170.0, 255, 255);<br />

color purple2 = color(212.5, 255, 255);<br />

color[][]cols = { ➥<br />

{ red1, orange1, yellow1, green1, cyan1, blue1, purple1 },<br />

{ red2, orange2, yellow2, green2, cyan2, blue2, purple2 }<br />

};<br />

int w = width/cols[0].length;<br />

int h = w;<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!