We are about to switch to a new forum software. Until then we have removed the registration on this forum.
how can I make a series of circles that is transparent in the edges while dark in the middle using while loops
Homework?
Show your code
What have you tried?
int diam=400; int change=20; void setup(){ size(400,400); background(255); fill(10,10,10,255); ellipse(width/2,height/2,100,100); } void draw(){ fill(255,255,255,100); while(diam>=0){ ellipse(width/2,height/2,diam,diam); diam=diam-change; strokeWeight(5); stroke(12,247,65); } }
I want it to be dark in the middle while light on the edges
StrokeWeight you don't need
To have the effect, place fill directly before ellipse in the ellipse and give it a fourth parameter that increases from 0 to 100
It's the opacity
Use noStroke (); before ellipse
something like this I need it to look
did you follow what I said?
post your entire code
int diam=400; int change=20; void setup(){size(400,400); background(255);fill(10,10,10,150); ellipse(width/2,height/2,100,100); }
void draw(){
while(diam>=0){fill(255,255,255,50);ellipse(width/2,height/2,diam,diam); diam=diam-change; stroke(12,247,65); }}
??
I wrote
int diam=400; int change=20; int a1=0; void setup() { size(400, 400); background(0); // stroke(255); // fill(10, 10, 10, 150); // ellipse(width/2, height/2, 100, 100); noStroke(); } void draw() { while (diam>=0) { fill(2, 255, 2, a1); ellipse(width/2, height/2, diam, diam); diam=diam-change; // stroke(12, 247, 65); a1++; } }
Answers
Homework?
Show your code
What have you tried?
I want it to be dark in the middle while light on the edges
StrokeWeight you don't need
To have the effect, place fill directly before ellipse in the ellipse and give it a fourth parameter that increases from 0 to 100
It's the opacity
Use noStroke (); before ellipse
something like this I need it to look
did you follow what I said?
post your entire code
int diam=400; int change=20; void setup(){size(400,400); background(255);fill(10,10,10,150); ellipse(width/2,height/2,100,100); }
void draw(){
while(diam>=0){fill(255,255,255,50);ellipse(width/2,height/2,diam,diam); diam=diam-change; stroke(12,247,65); }}
??
I wrote
To have the effect, place fill directly before ellipse in the ellipse and give it a fourth parameter that increases from 0 to 100
It's the opacity