# Color changing flower screen saver

**URL:** <https://discourse.processing.org/t/color-changing-flower-screen-saver/32824>\
**Category:** Beginners\
**Tags:** homework\
**Created:** [October 14, 2021, 6:18am UTC](https://discourse.processing.org/t/color-changing-flower-screen-saver/32824 "2021-10-14T06:18:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![williammannisto](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@williammannisto](https://discourse.processing.org/u/williammannisto)\
**Post date:** [October 14, 2021, 6:18am UTC](https://discourse.processing.org/t/color-changing-flower-screen-saver/32824/1 "2021-10-14T06:18:44Z")

</div>

im trying to make a color changing flower screen saver for my mom as a assignment i have to do but im using ellipses and cant figure out how to make the ellipse rotate more than once in the exact same spot it was in last time can you guys help me?pls

void setup() {  
size(500,500);  
frameRate(1);  
}  
float z = 90;  
color aColor = color(random(0,255),random(0,255),random(0,255));  
color bColor = color(random(0,255),random(0,255),random(0,255));  
color cColor = color(random(0,255),random(0,255),random(0,255));  
color dColor = color(random(0,255),random(0,255),random(0,255));  
color eColor = color(random(0,255),random(0,255),random(0,255));  
color fColor = color(random(0,255),random(0,255),random(0,255));  
color gColor = color(random(0,255),random(0,255),random(0,255));  
color hColor = color(random(0,255),random(0,255),random(0,255));  
color iColor = color(random(0,255),random(0,255),random(0,255));  
color jColor = color(random(0,255),random(0,255),random(0,255));  
color kColor = color(random(0,255),random(0,255),random(0,255));  
color lColor = color(random(0,255),random(0,255),random(0,255));  
color mColor = color(random(0,255),random(0,255),random(0,255));  
color nColor = color(random(0,255),random(0,255),random(0,255));  
void draw() {  
translate(width/2,height/2);  
background(0, 200, 255);  
fill(0,180,0);  
rect(-10,20,20,100);  
fill(132,0,48);  
ellipse(0,0,50,50);  
fill(aColor);  
stroke(bColor);  
rotate(z);  
{z += 180;  
if (z \> 280);{  
z = 90;  
}  
ellipse(0,0,30,80);  
}  
}

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [October 14, 2021, 1:13pm UTC](https://discourse.processing.org/t/color-changing-flower-screen-saver/32824/2 "2021-10-14T13:13:50Z")

</div>

Hi  
Welcome

Here is how to use rotate

> **[Reference](https://processing.org/reference/rotate_.html)**
>
> Rotates a shape the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to TWO\_PI) or converted to radians with the radians() function.

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [October 14, 2021, 1:32pm UTC](https://discourse.processing.org/t/color-changing-flower-screen-saver/32824/3 "2021-10-14T13:32:44Z")

</div>

[https://funprogramming.org/30-Multiple-rotating-objects-and-reset-matrix.html](https://funprogramming.org/30-Multiple-rotating-objects-and-reset-matrix.html)

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [October 14, 2021, 2:50pm UTC](https://discourse.processing.org/t/color-changing-flower-screen-saver/32824/4 "2021-10-14T14:50:01Z")

</div>

Hi!  
I have a few suggestions for your code! It could make the code shorter faster and better!

> **[Reference](https://processing.org/reference/Array.html)**
>
> An array is a list of data. It is possible to have an array of any type of data. Each piece of data in an array is identified by an index number representing its position in the array. The first eleme…

> **[Reference](https://processing.org/reference/colorMode_.html)**
>
> Changes the way Processing interprets color data. By default, the parameters for fill(), stroke(), background(), and color() are defined by values between 0 and 255 using t…

> **[Color](https://processing.org/tutorials/color/)**
>
> An introduction to digital color.

otherwise, you can always check out the processing reference!

> **[Reference](https://processing.org/reference/rotate_.html)**
>
> Rotates a shape the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to TWO\_PI) or converted to radians with the radians() function.

> **[Reference](https://processing.org/reference/translate_.html)**
>
> Specifies an amount to displace objects within the display window. The x parameter specifies left/right translation, the y parameter specifies up/down translation, and the z param…

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [October 14, 2021, 3:11pm UTC](https://discourse.processing.org/t/color-changing-flower-screen-saver/32824/5 "2021-10-14T15:11:46Z")

</div>

@williammannisto note that using frameRate(1) making execution very slow

```auto
void setup() {
size(500,500);
frameRate(1);
}

```
