Day of Color
- PDF of presentation slides
- sketchtext001: grayscale (code)
- sketchtext002: complementary color (code)
To run the code in Processing, you will need the MyGUI library.
In class code:
We seem to have found another bug, this one resolved by moving the colorMode() call to draw().
color frontColor, backColor;
int hueValue, compHueValue;
void setup() {
size(500, 500);
//default:
// colorMode(RGB, 256);
// standard format for HSB (degrees):
colorMode(HSB, 360);
frameRate(15);
hueValue = 0;
compHueValue = hueValue + 180;
smooth();
}
void draw() {
colorMode(HSB, 360);
// println (hueValue + "t" + compHueValue);
frontColor = color(hueValue, 359, 359);
backColor = color (compHueValue, 359, 359);
background(backColor);
fill(frontColor);
noStroke();
ellipse(width/2, height/2, 500, 500);
hueValue+=1;
if (hueValue == 360)
hueValue = 0;
compHueValue = hueValue + 180;
if (compHueValue >= 360)
compHueValue -= 360;
}
bene posted on February 12th, 2008 Add comment