/** * North Sea: analyse colour and light. * Mouve the mouse over the image. */ PImage wall; void setup() { size(600, 651); wall = loadImage("sea2.jpg"); stroke(255); } void draw() { background(wall); color c = get(mouseX, mouseY); float r = red(c); // Extract red float g = green(c); // Extract green float b = blue(c); // Extract blue fill(c); rect(420, 490, 100, 80); fill(r, 0, 0); rect(80, 80, 100, 80); // Red component fill(0, g, 0); rect(180, 80, 100, 80); // Green component fill(0, 0, b); rect(280, 80, 100, 80); // Blue component }