xxxxxxxxxx
boolean d = false;
int x,y,z;
int [] X= new int [12];
int [] Y= new int [12];
int [] Z= new int [12];
boolean [] coil = new boolean [13];
boolean [] pick = new boolean [3];
color c = color(x,y,z);
PFont f ;
boolean say = false;
int size1 = 5;
void setup(){
size(1000,1000);
background(255);
f = loadFont ("Arial-Black-48.vlw");
X[1] = 255;X[2] = 117;X[3] = 45;X[4] = 186;X[5] = 0;X[6] = 201;X[7] = 255;X[8] = 255;X[9] = 224;X[10] = 94;X[11] = 171;
Y[1] = 0; Y[2] = 32; Y[3] = 9; Y[4] = 75; Y[5] = 0;Y[6] = 115;Y[7] = 255;Y[8] = 247;Y[9] = 223;Y[10] = 86;Y[11] = 121;
Z[1] = 0; Z[2] = 12; Z[3] = 0; Z[4] = 50; Z[5] = 0;Z[6] = 96; Z[7] = 255;Z[8] = 168;Z[9] = 208;Z[10] = 3; Z[11] = 198;
for(int i = 0; i < 12;i++ ){
coil[i] = false;
}
}
void draw (){
c = color(x,y,z);
if(d){
fill(c);
noStroke();
ellipse(mouseX,mouseY,size1,size1);
}
noStroke();
fill(255,196,202);
rect(0,0,1.5*width/8,height);
rect(0,6*height/8,width,2*height/8);
strokeWeight(20);
stroke(255,255,127);
line(1.5*width/8,0,1.5*width/8,6*height/8);
line(1.5*width/8,6*height/8,width,6*height/8);
noStroke();
fill(c);
ellipse(6.5*width/8,6.5*height/8,60,60);
strokeWeight(5);
stroke(0);
fill(0);
textFont (f,15);
text("current color",850,800);
fill(32,93,2);
strokeWeight(10);
textFont (f,25);
text("color pick",20,50);
fill(246,252,138);
stroke(172,247,32);
rect(850,900,100,50);
fill(200,32,247);
text("save",868,932);
fill(246,252,138);
stroke(172,247,32);
rect(710,900,100,50);
fill(200,32,247);
text("clean",725,932);
textFont (f,25);
fill(0,16,127);
text("size",350,800);
noStroke();
fill(255);
ellipse(440,790,size1,size1);
noStroke();
fill(255,0,0);
triangle(475,770,465,780,485,780);
triangle(475,810,465,800,485,800);
stroke(118,155,242);
textFont (f,30);
fill(238,242,118);
ellipse(357,873,280,70);
stroke(104,1,127);
fill(179,118,242);
text("brighter/darker",237,883);
fill(0,16,127);
triangle(170,860,150,880,170,900);
triangle(530,860,550,880,530,900);
for(int i = 1; i < 12;i+=2 ){
if(dist(mouseX,mouseY,45,80+i*60)<=60){
strokeWeight(15);
stroke(167,252,138);
ellipse(45,80+i*60,60,60);
}
}
for(int i = 2; i <= 10;i+=2 ){
if(dist(mouseX,mouseY,130,20+i*60)<=60){
strokeWeight(15);
stroke(167,252,138);
ellipse(130,20+i*60,60,60);
}
}
for(int i = 1; i < 12; i= i+2){
fill(color(X[i],Y[i],Z[i]));
if(!coil[i]){
noStroke();}
else
{stroke(252,1,1);}
ellipse(45,80+i*60,60,60);
}
for(int i = 2; i <= 10; i= i+2){
fill(color(X[i],Y[i],Z[i]));
if(!coil[i]){
noStroke();}
else
{stroke(252,1,1);}
ellipse(130,20+i*60,60,60);
}
frameRate(5000);
}
void mousePressed(){
d = true;
for(int i = 1; i < 12;i+=2 ){
if(dist(mouseX,mouseY,45,80+i*60)<=60){
coil[i] = true;
x = X[i];
y = Y[i];
z = Z[i];
}
else{
coil[i]= false;
}
}
for(int i = 2; i <= 10;i+=2 ){
if(dist(mouseX,mouseY,130,20+i*60)<=60){
coil[i] = true;
x = X[i];
y = Y[i];
z = Z[i];
}
else{
coil[i]= false;
}
}
if(dist(mouseX,mouseY,475,772)<=5){
size1+=5;
}
if(dist(mouseX,mouseY,475,808)<=5){
size1-=5;
}
if(dist(160,880,mouseX,mouseY)<=20){
x+=5;
y+=5;
z+=5;
}
if(dist(540,880,mouseX,mouseY)<=20){
x-=5;
y-=5;
z-=5;
}
if(mouseX>= 850 && mouseX<= 950 && mouseY >= 900 && mouseY <= 950){
saveFrame();
}
if(mouseX>= 710 && mouseX<= 810 && mouseY >= 900 && mouseY <= 950){
background(255);
}
}
void mouseReleased(){
d = false;
}
void keyPressed(){
if(key == 's'){
saveFrame();
}
if (key == 'r'){//lip
x=255;y = 0;z =0;
}
if (key == 'h'){//hair
x=117;y=32;z=12;
}
if (key == 'H'){//hair
x=45;y=9;z=0;
}
if (key == 'l'){
x=186;y=75;z=50; //hair
}
if (key == 'b'){//black
x=y=z=0;
}
if (key == 'e'){//eye
x=201;y=115;z=96;
}
if (key == 'd'){//white
x=y=z=255;
}
if (key == 'y'){//yellow
x=255;y=247;z=168;
}
if (key == 'g'){//gray
x=224;y=223;z=208;
}
if (key == 'c'){//cloth
x=94;y=86;z=3;
}
if (key == 'f'){//face
x=171;y=121;z=198;
}
if (key == '9'){
size1 = 20;
}
if (key == '5'){
size1 = 10;
}
if (key == '1'){
size1= 5;
}
if (key == ','){
x+=2;y+=2;z+=2;
}
if (key == '.'){
x-=2;y-=2;z-=2;
}
}
void keyReleased(){
}