Processing Patterns

void setup() {
size(800, 800);
smooth();
noLoop();
}

void draw() {
background(255,171,229);
stroke(255,171,229);
strokeWeight(3);

float blue_prob = 0.60;
float purple_prob = 0.10;
float yellow_prob = 0.30;
float num = random(1);
if (num < blue_prob) {
fill(199,245,255);

} else if (num < purple_prob + blue_prob) {
fill(216,159,255);

} else {
fill(246,252,174);

}

int i = 0;
int iMax = 300;

while (i < iMax ) {

float x = random (width);
float y = random (height);

ellipse (x, y, 60, 60);
i = i + 1;
}
}

void mousePressed() {
redraw();
}

 


void setup() {
size(600,600);
background(198,252,229);
smooth();
noStroke();
}

void draw() {

for (int y=5; y<=height; y+=50) {
for (int x = 5; x <= width; x +=50) {
if (mousePressed == true){
fill(252,127,182);
triangle(x,y,x+40,y+40,x,y+40);
}else{
fill(54,209,196);
triangle(x,y,x+40,y+40,x,y+40);
}
}
}
}

screen-shot-2017-02-28-at-6-20-33-pm

void setup() {
size(800,800);
background(65,238,203);

}

void draw() {
stroke(249,242,150);
strokeWeight(3);
for (int i = 0; i <= width; i++) {
line(i*i+.5,0,i,height);
}
}

screen-shot-2017-02-28-at-6-20-50-pm

color[] purple = {#511E78,#8B2F97,#CF56A1,#FCB2BF,#BB99CD};
color[] palette = purple;

int s = 40;

void setup() {
size(600,600);
background(purple[0]);
smooth();
noStroke();
for(int x=0; x < width; x += s) {
for(int y=0; y < height; y += s) {
fill(palette[int(random(0,5))]);
rect(x, y, s, s);
}
}
}

void draw() {
fill(palette[int(random(1,5))]);
int x = int(random(width/s))*s;
int y = int(random(width/s))*s;
rect(x, y, s, s);
}

screen-shot-2017-02-28-at-6-21-12-pm

size (700,700);
background (234,43,162);
smooth();
fill(251,150,150, 100);

for (int x = -50; x <= width; x += 100) {
for (int y = 100; y <= height ; y += 100) {
noStroke();
triangle (x , y, (x + 50), ( y-100), (x +100) , y);
}
}

fill(246,202,151, 50);
for (int x = 0; x <= width; x += 100) {
for (int y = 0; y <= height ; y += 100) {
triangle (x , y, (x + 50), ( y-100), (x +100) , y);
}
}

 

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