Project 4-String Art

I wanted to make this look trippy

stringDownload
function setup() {
    createCanvas(400, 300);
    background(0);
}

function draw() {
    stroke(255);
    for (var i = 0; i <= 50; i += 1) { //border pattern
        stroke(random(0, 256), random(0, 256), random(0, 256), 150); //rainbow colors
        //line(0, 10*i, 10*i, 300);
        //line(10*i, 0, 400, 10*i);
        line(0, 150+(4*i), 10*i, 300); //bottom left
        line(400, 150+(4*i), 400-(10*i), 300); //bottom right
        line(400-(10*i), 0, 0, 4*i); //top right
        line(10*i, 0, 400, 4*i);
    }
    stroke(0, 0, 255);
    noFill();
    square(150, 100, 100);
    for (var n=0; n<=10; n+=1) {
        var shade=200-12*n;
        stroke(shade, 0, 0);
        line(250-(10*n), 100, 150+(10*n), 200);
    }
    noLoop();
}

Leave a Reply