Code viewer for World: Tutorial 2.4 (clone by Lau...

// Cloned by Laura Campbell on 18 Sep 2022 from World "Tutorial 2.4" by "Coding Train" project 
// Please leave this clone trail here.
 

/*
https://vimeo.com/channels/learningp5js/138331801
*/
// var col = 0;
var r = 0;
var b = 225;

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

function draw() {
  // background
  //col = mouseX;
  //col = map(mouseX, 0, 600, 0, 255);
  r = map(mouseX, 0, 600, 0, 255);
  b = map(mouseX, 0, 600, 255, 0);
  // background(col);
  background(r, 0, b);
  
  // ellipse
  fill(250, 118, 222);
  ellipse(mouseX, 200, 64, 64);
}