For my wallpaper, I wanted to try to replicate the “jazz” pattern seen on your typical office styrofoam cup.
//Cole Savitz-Vogel
//csavitzv
//Section A
function setup() {
createCanvas(600, 600);
background(0);
noLoop();
}
function draw() {
fill(230);
background(230);
for (var y = -60; y <= height+50; y+= 70) {
stripes(0, y);
}
for (var x = -100; x <= width+50; x += 150) {
for (var y = -10; y <= height+50; y += 70)
pastel(x, y);
}
for (var x = -80; x <= width+50; x += 100) {
for (var y = -50; y <= height+50; y += 70)
curvy(x, y);
}
for (var x = -50; x <= width+50; x += 2) {
for (var y = -50; y <= height+50; y += 10)
styro(x, y);
}
}
//Stripes - The backmost blue line
function stripes(x,y) {
push();
translate(x,y);
strokeWeight(30);
curveTightness(3);
stroke(94, 205, 255, 90);
curve(-3000, 60, 200, 36, 400, 20, 3000, 50);
pop();
}
//Curvy - The purple frontmost curves; The color varies slightly
function curvy(x, y) {
push();
noFill();
translate(x,y);
strokeWeight(5);
curveTightness(-5)
rotate(1);
stroke(random(100, 130), 10, (100, 150));
curve(-10, 16, 50, 46, 90, 34, 130, 60);
translate(10, 20);
rotate(3);
curve(-10, 6, 50, 36, 90, 24, 130, 50);
pop();
}
//Pastel - The middleground blue lines; The color varies slightly
function pastel(x,y) {
push();
translate(x,y);
strokeWeight(15);
stroke(74, 225, 255, random(90,120));
curveTightness(0)
curve(0, 16, 100, 46, 150, 34, 190, 60);
translate(40, 25);
rotate(.05);
stroke(94, 205, 255, random(90, 120));
curve(0, 6, 100, 36, 150, 24, 190, 50);
translate(30, -20);
rotate(-.05);
stroke(74, 215, 225, random(90, 120));
curve(0, 6, 100, 36, 150, 24, 190, 50);
translate(30, 15);
rotate(.05);
stroke(54, 235, 245, random(90, 120));
curve(0, 6, 100, 36, 150, 24, 190, 50);
pop();
}
//Styro - A filter-like pattern of random small lines and dots to give the underlying pattern a styrofoam feel
function styro(x, y) {
push();
translate(x, y);
noStroke();
fill(230, random(100,250));
ellipse(random(0, 100), random(0, 100), random(1, 3), random(1,3));
strokeWeight(random(.01, .1));
stroke(230, random(100,250));
line(random(0, 100), random(0, 100), random(0, 100), random(0, 100));
pop();
}