A
You can try this and tell me that I don't know, which color is the one you want first.int N1; //the number of rings
int N2; //timer
int mX; //mX is current mouseX position
int mY; //mY is current mouseY position
int Dstep; // the increment at which the diameter will increase
int Astep; // the increment and which alpha will decrease
int Alp; //alpha value
int Dia; //diameter value
int inc = 1;
boolean test = false; //se añade
void setup() {
size(800, 600);
colorMode(HSB, 100);
noFill();
strokeWeight(2);
smooth();
frameRate(20);
N1 = 20;
N2 = 0;
Alp = 100;
Dia = 10;
}
void mouseClicked() {
mX = mouseX;
mY = mouseY;
Math();
Dia = 10;
Alp = 100;
N2=0;
stroke(50, 100, 100, Alp); //puede cambiar para un color u otro
//stroke(10, 10, 10, Alp); //puede cambiar para un color u otro
test = true; //se añade
}
void draw() {
N2 = N2 + inc;
if (N2>N1) {
inc = -1;
if(test){ //se añade if con test boolean
stroke(50, 100, 100, Alp); //puede cambiar para un color u otro
//stroke(10, 10, 10, Alp); //puede cambiar para un color u otro
}else{
stroke(10, 10, 10, Alp); //puede cambiar para un color u otro
//stroke(50, 100, 100, Alp); //puede cambiar para un color u otro
}
}
else if (N2<1) {
inc = 1;
if(test){ //se añade if con test boolean
stroke(50, 100, 100, Alp); //puede cambiar para un color u otro
//stroke(10, 10, 10, Alp); //puede cambiar para un color u otro
}else{
stroke(10, 10, 10, Alp); //puede cambiar para un color u otro
//stroke(50, 100, 100, Alp); //puede cambiar para un color u otro
}
}
Ellipse();
}
void Math() {
Dstep = 20; //determinar aqui el diametro que queramos alcanzar
Astep = 100/N1;
}
void Ellipse() {
ellipse(width/2, height/2, N212, N212);
strokeWeight(N2/7+0.5);
println("N2:"+N2);
}
Update:I told you about the first part but don't remember this until I read it again.Besides, I can't make it when the circle has reached the maximum.
erase as they decrease in size.The only thing I can think of is playing with background, strokeAnd with him strokeWeightBecause I don't think you want to use clear()I'll give you an example of what I'm telling you, I hope you can help.int N1; //the number of rings
int N2; //timer
int mX; //mX is current mouseX position
int mY; //mY is current mouseY position
int Dstep; // the increment at which the diameter will increase
int Astep; // the increment and which alpha will decrease
int Alp; //alpha value
int Dia; //diameter value
int inc = 1;
boolean test = false;
void setup() {
size(800, 600);
colorMode(HSB, 100);
bg = color(180, 50, 50); // se añade
noFill();
strokeWeight(2);
smooth();
frameRate(20);
N1 = 20;
N2 = 0;
Alp = 100;
Dia = 10;
background(bg); //se añade
}
void mouseClicked() {
mX = mouseX;
mY = mouseY;
Math();
Dia = 10;
Alp = 100;
N2=0;
stroke(50, 100, 100, Alp);
//stroke(10, 10, 10, Alp);
test = true;
}
void draw() {
N2 = N2 + inc;
if (N2>N1) {
println("sub ");
inc = -1;
if(test){
//stroke(50, 100, 100, Alp);
//stroke(10, 10, 10, Alp);
stroke(180, 50, 50, Alp); //se añade este es el color que usa el bg
}else{
//stroke(10, 10, 10, Alp);
//stroke(50, 100, 100, Alp);
stroke(180, 50, 50, Alp); //se añade este es el color que usa el bg
}
//clear();
}
else if (N2<1) {
inc = 1;
if(test){
stroke(50, 100, 100, Alp);
//stroke(10, 10, 10, Alp);
}else{
stroke(10, 10, 10, Alp);
//stroke(50, 100, 100, Alp);
}
}
Ellipse();
}
void Math() {
Dstep = 20; //determinar aqui el diametro que queramos alcanzar
Astep = 100/N1;
}
void Ellipse() {
ellipse(width/2, height/2, N212, N212);
//strokeWeight(N2/7+0.5);
if (N2>N1) { //se añade cuando se cumple se cambia el tamaño
strokeWeight(10);
}else if (N2<1){
//strokeWeight(N2/7+0.5);
strokeWeight(2);
}
//println("N2:"+N2);
}