> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.6$vCay$I8uL/rev.471
 * 
 * authors: 
 *   Marcos Sader
 *   
 *   
 *   hernan
 *   
 *   Sergio Majluf
 *   russell goldenberg
 *   jjjolll
 *   
 *   Pablo Olmos de Aguilera Corradini

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// Pressing Control-R will render this sketch.

int count = 0;
boolean goUp = true;
int radio = 80;
boolean goUpRadio = true;
int rojo = random(100,255);
int nextRojo = random(100,255);
boolean goUpRojo = (rojo > nextRojo);

void setup() {
  size (800, 800);
  smooth();
}

void draw () {
  if (mousePressed) {
    stroke(count);
    fill(count);
    if(goUp) count++;
    else count--;
    if(count >= 255) goUp = false;
    if(count <= 0) goUp = true;
  } else {
    if(goUpRojo) {
        nextRojo++;
        if(nextRojo >= rojo) {
            rojo = random(100,255);
            goUpRojo = (rojo > nextRojo);
        }
    } else {
         nextRojo--;
        if(nextRojo <= rojo) {
            rojo = random(100,255);
            goUpRojo = (rojo > nextRojo);
        }
    }
    stroke(nextRojo,20,50);
    fill (nextRojo, 20, 50);
  }
  ellipse(mouseX, mouseY, radio, radio);
    if(goUpRadio) radio++;
    else radio--;
    if(radio >= 150) goUpRadio = false;
    if(radio <= 10) goUpRadio = true;
}

// Built as a variation on http://processingjs.org/learning/basic/random