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.

the decreasing wavelengths of the individual colors forming the visible light spectrum—<br />

the small fraction of the total electromagnetic spectrum our eyes can see. Red’s wavelength<br />

is approximately 700 nanometers (nm), <strong>and</strong> violet’s is around 400 nm. Perhaps you<br />

remember roy g biv (red, orange, yellow, green, blue, indigo, violet), a mnemonic many of<br />

us learned to remember the colors in the rainbow. Following is a simple sketch that<br />

creates a smooth color gradient across the visual spectrum (see Figure 10-12):<br />

// ROY G BIV<br />

size(400, 120);<br />

noStroke();<br />

colorMode(HSB);<br />

float w = width/(255-42.5);<br />

for (int i=0; i

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

Saved successfully!

Ooh no, something went wrong!