xxxxxxxxxx
136
function setup() {
createCanvas(500, 800);
}
function draw() {
background(220);
stroke(134, 82, 84);
line(0, 0, 500, 0);
// for loop experiment: drawing by line, each line is 50pt high
for (let i= 0; i < 200; i++) {
if(i < 50){
line(0, 1*i, 500, 1*i);
}
else if(i < 100){
// darker pink
stroke(134, 82, 84);
line(0, 1*i, 50, 1*i);
// light pink
stroke(244, 171, 157);
line(50, 1*i, 500, 1*i);
}
else if(i < 150){
stroke(244, 171, 157);
line(50, 1*i, 500, 1*i);
//for some reason the color has changed but i like it
stroke(134, 82, 84);
line(0, 1*i, 450, 1*i);
}
else if(i < 200){
stroke(244, 171, 157);
line(0, 1*i, 500, 1*i);
}
}
// for loop experiment 2: drawing by blocks, filling the whole 200 pt block and then adding a shape that will make the pattern work
// also, will experiment later with how to colors superpose with each other
for(let i=0; i < 400; i++){
if (i < 250){
// bright pink
stroke(250, 138, 186);
line(0, 200 + 1*i, 500, 200 + 1*i);
}
else if (i < 300) {
// bright orange red
stroke(207, 74, 59);
line(50, 1*i, 500, 1*i);
}
else if (i < 350) {
stroke(207, 74, 59);
line(450, 1*i, 500, 1*i);
}
else if (i < 400) {
stroke(207, 74, 59);
line(0, 1*i, 500, 1*i);
}
}
// third block
for(let i=0; i < 600; i++){
if (i < 450){
// red
stroke(168, 29, 42);
line(0, 400 + 1*i, 500, 400 + 1*i);
}
else if (i < 500) {
// bright red
stroke(197, 1, 23);
line(50, 1*i, 500, 1*i);
}
else if (i < 550) {
stroke(197, 1, 23);
line(450, 1*i, 500, 1*i);
}
else if (i < 600) {
stroke(197, 1, 23);
line(0, 1*i, 500, 1*i);
}
}
// fourth block
for(let i=0; i < 800; i++){
if (i < 650){
// darkish red
stroke(107, 24, 32);
line(0, 600 + 1*i, 500, 600 + 1*i);
}
else if (i < 700) {
// darkest red
stroke(72, 32, 43);
line(50, 1*i, 500, 1*i);
stroke(107, 24, 32);
line(0, 200 + 1*i, 50, 200 + 1*i);
}
else if (i < 750) {
stroke(72, 32, 43);
line(450, 1*i, 500, 1*i);
stroke(107, 24, 32);
line(0, 200 + 1*i, 450, 200 + 1*i);
}
else if (i < 800) {
stroke(72, 32, 43);
line(0, 1*i, 500, 1*i);
}
}
}