# Rainbow animation, one color at a time

**URL:** <https://forum.electromage.com/t/rainbow-animation-one-color-at-a-time/437>\
**Category:** Patterns and Code\
**Created:** [June 30, 2020, 4:07pm UTC](https://forum.electromage.com/t/rainbow-animation-one-color-at-a-time/437 "2020-06-30T16:07:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Troy](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@Troy](https://forum.electromage.com/u/Troy)\
**Post date:** [June 30, 2020, 4:07pm UTC](https://forum.electromage.com/t/rainbow-animation-one-color-at-a-time/437/1 "2020-06-30T16:07:50Z")

</div>

How would I produce a rainbow animation where the entire strip is the same color, but still animates through the entire hue spectrum?

---

<div class="post-metadata">

**Author:** ![zeb](https://forum.electromage.com/user_avatar/forum.electromage.com/zeb/32/257_2.png) [@zeb](https://forum.electromage.com/u/zeb)\
**Post date:** [June 30, 2020, 4:18pm UTC](https://forum.electromage.com/t/rainbow-animation-one-color-at-a-time/437/2 "2020-06-30T16:18:15Z")

</div>

How about this:

```
export function beforeRender(delta) {
  t1 = time(.1)
}

export function render(index) {
  h = t1
  s = 1
  v = 1
  hsv(h, s, v)
}
```

---

<div class="post-metadata">

**Author:** ![Troy](https://forum.electromage.com/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@Troy](https://forum.electromage.com/u/Troy)\
**Post date:** [June 30, 2020, 5:30pm UTC](https://forum.electromage.com/t/rainbow-animation-one-color-at-a-time/437/3 "2020-06-30T17:30:00Z")

</div>

Thanks, that worked great
