xxxxxxxxxx
// this is a comment
/* this is a comment also
but it can be
lots and lots
of lines */
// for help, go here: https://p5js.org/
// things like size and position are in pixels
// setup runs once when you hit play!
function setup() {
createCanvas(windowWidth, windowHeight); // this is saying how big our canvas is
// colors can be:
// a single value = luminosity (0-255)
// two values = luminosity, alpha (0-255)
// three values = red, green, blue (0-255)
// four values = red, green, blue, alpha (0-255); alpha is transparency
// hex string, e.g. "#0000ff"
// word that matches a web color, e.g. "turquoise"
// web colors are here: https://en.wikipedia.org/wiki/Web_colors
// r g and b are because humans and vision
// see here: https://en.wikipedia.org/wiki/Trichromacy
// 0-255 is because byte: https://en.wikipedia.org/wiki/Byte
background("thistle"); // this is our background color
}
// draw runs every frame over and over and over and over and over
function draw() {
//background("thistle"); // this is our background color
// random makes random numbers: one argument is a range, two args are a min and a max
fill(random(255), random(20, 100), random(100, 255),50);
stroke("DarkCyan");
ellipse(mouseX, mouseY, random(80), random(80)); // draw an ellipse - arguments are x, y, width, height
//ellipse(random(width), random(height), random(80), random(80)); // draw an ellipse - arguments are x, y, width, height
}