/* Every Color Square (after Malevich) // version 1.0 // Displays ever color counting down from white (255, 255, 255) and ending with black. // created October 30, 2007 // Andy Doro */ int x,y,side; // location,size color theColor; void setup() { size(500,500); //frameRate(60); // define framerate, if you wish theColor = color(255,255,255); // start with white rectMode(CENTER); x = width/2; // calculate center y = height/2; side = (height*3)/4; noStroke(); // no border on square } void draw(){ background(255); // white background fill(theColor); rect(x,y,side,side); // draw the square if (!online) { print("r: " + int(red(theColor))); // what color are we at? print(" g: " + int(green(theColor))); println(" b: " + int(blue(theColor))); //println(frameRate); // how fast are we? } else { status("r: " + int(red(theColor)) + " g: " + int(green(theColor)) + " b: " + int(blue(theColor))); } if (theColor == color(0,0,0)) { // if the color is black we are done noLoop(); // stop the program } theColor--; // go to next color }