xxxxxxxxxx
/*-----------------------------
Monochrome
Match the square's color to the background
02/06/2017
Austin DiLorenzo
dilorenzo.14@osu.edu
02/06/2017
Austin DiLorenzo
-----------------------------*/
float H = random(int(255));
float S = random(int(255));
void setup(){
size(1000,1000);
}
void draw(){
colorMode(HSB);
background(H,S,255);
float x = map(mouseX, 0,height, 0,255);
float y = map(mouseY, 0,width, 0,255);
fill(x,y,255);
noStroke();
rect(mouseX - 25, mouseY - 25, 50,50);
println(x + "," + y + "," + "-----" + H + "," + S);
if((x <= H+5)&&(x >= H-5)&&(y >= H-5)&&(y <= S+5)){
H = random(int(255));
S = random(int(255));
}
}