Shapes and Colors

Use P5.js to create a sketch that works with the mouse. You will need to change the colors to our school colors of red and black. To find out the codes for those colors Google RGB and the color (example: RGB code for red). You will also need to add your name.

Code for adding your name:

textSize(32);

text('Your Name', 10, 30);


Code for PLAYING WITH THE MOUSE


function setup() {

createCanvas(600, 400);

//BACKGROUND IN SETUP

background(100);

}


function draw() {

//background(100);

//MOUSE CONTROLED ELLIPSE

//fill(255,40,150)

//COLOR TRANSPARANCY IN FORTH VERIABLE

fill(255,40,150,50)

ellipse(mouseX,mouseY,200,200)

fill(230,220,110)

ellipse(mouseX,mouseY,100,100)

}

//new function mousePressed

//don't forget the curly bracets

function mousePressed(){

background(100);

}