xxxxxxxxxx
28
function setup(){
createCanvas(600,600);//giving size of a canvas//
background(255, 204, 0);//chose a yellow background colour, which will be used in order for patterns to stand out//
strokeWeight(3);//changes line boldness from thin to thick//
frameRate(90);//makes a smoother animation then before//
}
//recommended to move a mouse around the point ///
function draw() {
if (mouseIsPressed) // when mouse is pressed the colour will change shape's colour.//
{
stroke(r, g, b);// giving a stroke different RGB colours , they change when the mouse is pressed, if chosen, pressing slowly while moving the mouse will change one by one colour stoke//
fill(r, g, b);//giving a fill for the square of random RBG colours//
} else
// integer RGBA rotation
fill('blue');//original colour of a arch before the mouse is clicked is blue//
line(mouseY, mouseX, 300, 300);//shape which appears when I move the mouse anti clock wise)
r = random(255);
g = random(255);//“block scope variable”
b = random(255);
//these 3 are randomly showing RGB colours when a mouse is pressed.Piciking up a random value//
square(280, 280, 40, 40, 10);// position of square shape which is polished in circle"less then 20 changes its shape to be less oval" //
}