Olympic rings, how to make them problems?

Hello,

I’m trying to make the Olympic rings but I don’t know why the rings doesn’t make around just the stroke and instead just filling up.

Would be honored if anybody could explain what I’m doing wrong? (Newbie still)

This is the code:
size(400,300);
int[] x={100,200,300,150,250};
int[] y={100,100,100,200,200};
int[] r={0,0,255,255,0};
int[] g={0,0,0,255,255};
int[] b={255,0,0,0,0};

for(int i=0; i < x.length; i++){

strokeWeight(7);

fill(r[i],g[i],b[i]);
noFill();
ellipse(x[i],y[i],140,140);

}

Replace

with stroke(r[i],g[i],b[i]) , and move noFill() in setup.

Stroke sets the color used to draw lines and borders around shapes.

1 Like