# How do I set these circles up?

**URL:** <https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [February 5, 2020, 5:24pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567 "2020-02-05T17:24:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImConfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@ImConfused](https://discourse.processing.org/u/ImConfused)\
**Post date:** [February 5, 2020, 5:24pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/1 "2020-02-05T17:24:27Z")

</div>

I’m having a hard time figuring out how to change the colors and how to set up the circles.Help a example would help

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/ae2c6f0f276f3e2eb2785cafb6eb61635786fb9f.jpeg)

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 5, 2020, 5:40pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/2 "2020-02-05T17:40:18Z")

</div>

What have you tried so far? Can you draw a circle?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 7, 2020, 11:54am UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/3 "2020-02-07T11:54:29Z")

</div>

Which structure would you use to draw circles of different size again and again?

---

<div class="post-metadata">

**Author:** ![ImConfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@ImConfused](https://discourse.processing.org/u/ImConfused)\
**Post date:** [February 7, 2020, 12:37pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/4 "2020-02-07T12:37:51Z")

</div>

Loop circle,I just don’t know how to set it up and make it change colors

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 7, 2020, 12:44pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/5 "2020-02-07T12:44:22Z")

</div>

Brilliant

Which kind of loop?

See reference

Show your attempt: your entire code

---

<div class="post-metadata">

**Author:** ![ImConfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@ImConfused](https://discourse.processing.org/u/ImConfused)\
**Post date:** [February 7, 2020, 1:01pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/6 "2020-02-07T13:01:40Z")

</div>

That’s the thing I know it need a loop but I don’t know how to set it up to recreate the example

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 7, 2020, 1:18pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/7 "2020-02-07T13:18:36Z")

</div>

No, I am not doing this for you

Looking at your other posts, that has been said to you before

You need setup and draw - see reference

You need a loop - see reference under Iteration

[https://processing.org/reference/](https://processing.org/reference/)

Then place the loop in setup() or so and the ellipse() command therein

Chrisir

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 7, 2020, 1:23pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/8 "2020-02-07T13:23:42Z")

</div>

Also see this

[https://processing.org/tutorials/overview/](https://processing.org/tutorials/overview/)

Sections Hello World and Hello Mouse

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 7, 2020, 1:53pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/9 "2020-02-07T13:53:49Z")

</div>

Show your attempt, your not working code please

---

<div class="post-metadata">

**Author:** ![bucherjo](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@bucherjo](https://discourse.processing.org/u/bucherjo)\
**Post date:** [February 7, 2020, 10:44pm UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/10 "2020-02-07T22:44:56Z")

</div>

Hello ImConfused  
One possible Implementation which is based on random colors would be:

````auto
//set the xAxis and yAxis of your window
int windowX=500;
int windowY=500;
int radius;

//according to your excercise the Interval must be set to 20
int interval=20;

void settings(){
  size(windowX,windowY);
}

void setup(){
  background(255);
  radius=min(windowX,windowY);

  while(radius>interval){
    //create a random color with RGB values between 0 and 255
    fill(color(random(0,255),random(0,255), random(0,255)));
    
    //draw ellipse
    ellipse(width/2, height/2, radius, radius);
    
    //decrease the radius by the interval
    radius-=interval;
  }}```
````

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [February 8, 2020, 9:25am UTC](https://discourse.processing.org/t/how-do-i-set-these-circles-up/17567/11 "2020-02-08T09:25:02Z")

</div>

Well done you have just done his school work for him 😠
