Project 3 rrandell

sketch

/* Rani Randell
Section A
rrandell@andrew.cmu.edu
Project 03 */

var backcolor;
var x = 0;
var y = 0;

function setup() {
    createCanvas(400, 400);
    
}

function draw() {

	var R = mouseX;
    var G = mouseY;
    var B = mouseX;
    backcolor = color(R, G, B);
	background(backcolor); //make the background change randomly with the mouse movement
	
	noStroke(0);
	fill(161, 0, 0);
	rect(mouseX, 0, 10, 400);
	
	fill(161, 161, 0);
	rect(mouseX + 40, 0, 10, 400);
	
	fill(7, 136, 70);
	rect(mouseX + 80, 0, 10, 400);
	
	fill(162, 82, 3);
	rect(mouseX + 120, 0, 10, 400);
	
	fill(0, 33, 203);
	rect(mouseX - 40, 0, 10, 400);
	
	fill(153, 0, 77);
	rect(0, mouseY, 400, 10);
	
	fill(101, 130, 0);
	rect(0, mouseY + 40, 400, 10);
	
	fill(65, 102, 0);
	rect(0, mouseY + 80, 400, 10);
	
	fill(68, 10, 127);
	rect(0, mouseY + 160, 400, 10);



	}


For this project I really wanted to experiment with color when the mouse is moved around. I made a small optical illusion with both line and color. I was really inspired by Mondrian’s clean lines and geometry for this project.

Leave a Reply