Processing: 5 Patterns (Selin)

purple-grid screen-shot-2017-03-01-at-3-46-41-pm

size(600,600);
background(0);
strokeWeight(0.5);
stroke(#FFF9C9);

for (int y = 0; y < height; y = y + 20) {
for (int x = 0; x < width; x = x + 20) {
fill(#F3C9FF);
rect(x, y, 20, 20);
}
}


Screen Shot 2017-03-01 at 4.59.48 PM.png

boolean b = false;

size(640, 360);
background(#6E7FDE);
stroke(#B1DDF7);

int d = 20;
int middle = width/2;

for (int i = d; i <= width; i += d) {

if (i < middle) {
b = true;
} else {
b = false;
}

if (b == true) {
// Vertical line
line(i, d, i, height-d);
}

if (b == false) {
// Horizontal line
line(middle, i – middle + d, width-d, i – middle + d);
}
}


Yello Stipes.png

float inc = 0.01;
float scl = 20;
int cols, rows;

void setup()
{
size(940, 540);
cols = int(width / scl);
rows = int(height / scl);
colorMode(HSB);
background(#FEFFD3);
}

void draw()
{
int yoff = 0;
for (int y = 0; y< rows; y++){
float xoff = 0;
for (int x = 0; x< cols; x++){
float r = noise(xoff, yoff)*255;
PVector vector = new PVector(0,0).fromAngle(10);
xoff += 0;
stroke(#AB4DFF);
pushMatrix();
translate (x*scl, y*scl);
rotate(vector.heading());
line(0,0,scl,0);
popMatrix();

//rect(x*scl, y*scl, scl, scl);
}
yoff += inc;
}
}


screen-shot-2017-03-01-at-4-03-04-pm screen-shot-2017-03-01-at-4-04-40-pmscreen-shot-2017-03-01-at-4-05-42-pm

void setup() {
size(400, 400);
stroke(#FFEACE);
background(#F7C787);
}

void draw() {
line(150, 25, mouseX, mouseY);
}


screen-shot-2017-03-01-at-5-02-12-pm screen-shot-2017-03-01-at-5-19-23-pmscreen-shot-2017-03-01-at-5-21-26-pm

int barWidth = 20;
int lastBar = -1;

void setup()
{

fullScreen();
colorMode(HSB, height, height, height);
noStroke();
background(0);
}

void draw()
{
int whichBar = mouseX / barWidth;
if (whichBar != lastBar) {
int barX = whichBar * barWidth;
fill(mouseY, height, height);
rect(barX, 0, barWidth, height);
lastBar = whichBar;
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s