Processing Month, Day 22 - Patterns

Posted on 2011-05-22 by Jan Vantomme
Tags: processing, tutorial

Today we'll take a look at drawing patterns. I'll be using colorLib and the COLOURlovers API to color the artwork in an interesting way. You can download colorLib and install it in your libraries folder. These are the variables we need to declare at the beginning of our sketch.

ClLovers cl;
ClLoversTheme[] ctl;

Inside setup, we'll create the ClLovers object and use it to search the COLOURlovers website for palettes tagged with a word. I'm searching for strawberry in this example.

bc. cl = new ClLovers(this);
ctl = cl.searchForThemes("strawberry");

The algorithm for the pattern is easy. It just draws a bunch of lines on a grid. There are a few parameters you can use to control what the grid looks like. The number of lines and the decay. Have fun playing around with these examples.

Examples

The images with the lines were made by searching for the keyword strawberry, the ones with the rectangles by searching for sunshine.

A pattern made by searching for the keyword Strawberry

A pattern made by searching for the keyword Strawberry

A pattern made by searching for the keyword Sunshine

Download

Download the two sketches for Processing Month, Day 22 - Patterns.

Tweet this article