xxxxxxxxxx
64
//got a wierd erro the first time i ran this "Script error. (: line 0)"
//then i saw i had to turn off plain text in the accessibility settings in //github
//and it went away :)
let canvas;
let bgColor;
let button;
let button1;
let slider;
let label;
var r = 0;
var g =0;
var b= 0;
function setup() {
canvas = createCanvas(600, 600);
bgColor = color( random(255), random(255), random(255) );
createP('');
label = createP (" move slider to change size");
slider= createSlider(10,300,20);
background(bgColor);
rectMode(CENTER);
}
function changeColor(){
bgColor = color( random(255), random(255), random(255) );
}
function cicrl(){
var circ= {
x : mouseX,
y: mouseY
}
noFill();
stroke(r,g,b);
// rect (100,100, 50,50);
ellipse(circ.x, circ.y, slider.value(), slider.value());
}
function sqaure(){
var squre ={
x: mouseX,
y :mouseY
}
noFill();
stroke(b,r,g);
rect (squre.x,squre.y, slider.value(),slider.value());
}
function draw() {
r= map(mouseX, 0, 600, 255, 0);
g= map(mouseY, 0, 400, 0, 255);
b= map(mouseX, 0, 600, 0, 255);
sqaure();
cicrl();
}