// Declaring Variables. // Starting "time" float t = 0.0; float y; // Variables float r = 100; float g = 100; float b = 100; void setup() { size(720,600); smooth(); colorMode(RGB,100); } void draw() { background(r,g,b); // background // time; t +=0.01; float x =t; //lines for (int i = 0; i<=width; i++) { float y = noise(x)*height; point(i*10,y); x += 0.05; } //COLORS // R // If the mouse is on the right side of the screen is equivalent to // "if mouseX is greater than width divided by 2." if(mouseX > width/2) { r = r + 0.5; } else { r = r - 0.5; } // If r is greater than 255, set it back to 255. // If r is less than 0, set it back to 0. if (r > 100) { r = 100; } else if (r < 0) { r = 0; } if(mouseY < height/2) { r = r + 0.5; } else { r = r - 0.5; } // If r is greater than 255, set it back to 255. // If r is less than 0, set it back to 0. if (r > 100) { r = 100; } else if (r < 0) { r = 0; } // G if(mouseX < width/2) { g = g + 0.05; } else { g = g - 0.05; } // If r is greater than 255, set it back to 255. // If r is less than 0, set it back to 0. if (g > 100) { g = 100; } else if (r < 0) { g = 0; } if(mouseX > width/2) { g = g - 0.05; } else { g = g + 0.05; } // If r is greater than 255, set it back to 255. // If r is less than 0, set it back to 0. if (g > 100) { g = 100; } else if (r < 0) { g = 0; } // B if(mouseY < height/2) { b = b + 0.5; } else { b = b - 0.5; } // If r is greater than 255, set it back to 255. // If r is less than 0, set it back to 0. if (b > 100) { b = 100; } else if (b < 0) { b = 0; } }