# Fade between random colours for a background

**URL:** <https://discourse.processing.org/t/fade-between-random-colours-for-a-background/1433>\
**Category:** Coding Questions\
**Created:** [July 2, 2018, 12:39pm UTC](https://discourse.processing.org/t/fade-between-random-colours-for-a-background/1433 "2018-07-02T12:39:23Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 10, 2022, 11:15am UTC](https://discourse.processing.org/t/fade-between-random-colours-for-a-background/1433/14 "2022-06-10T11:15:49Z")

</div>

Hello @locky.mcdonald,

Related:  
[https://discourse.processing.org/t/ball-moving-linear-and-cosinusoidal/15209](https://discourse.processing.org/t/ball-moving-linear-and-cosinusoidal/15209)

Focus on this:

> [@Ball moving - Linear and Cosinusoidal](https://discourse.processing.org/t/ball-moving-linear-and-cosinusoidal/15209/1):
>
> ```auto
> //modulated cosinusoidal
> if (true)
> {
> count = 1-(0.5*cos(theta) + 0.5);
> 
> ```

You can also make it sinusoidal.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/fade-between-random-colours-for-a-background/1433)._
