# Color palette support?

**URL:** <https://forum.electromage.com/t/color-palette-support/192>\
**Category:** Patterns and Code\
**Created:** [January 16, 2020, 2:50pm UTC](https://forum.electromage.com/t/color-palette-support/192 "2020-01-16T14:50:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [February 10, 2020, 10:32pm UTC](https://forum.electromage.com/t/color-palette-support/192/6 "2020-02-10T22:32:37Z")

</div>

Here’s a quick math only hack I came up with. The idea is to stretch out the yellow area using a smooth function like sin(), taking only a quarter of the waveform. Notice that green is usually at 1/3, is now right in the middle. Both teals and purples are compressed to favor orange/yellows.

```auto
  h = h % 1 //make sure h is a value between 0 and 1, or this doesn't work
  h2 = h * sin(h * PI * .5)

```

Here’s the regular HSV next to this:  
 ![mod hsv](https://forum.electromage.com/uploads/default/original/1X/62b72812721453dd288566c65ba9da4347ae5538.png)

Here’s another variant that stretches out red quite a bit, compressing the distance between green and blue. This uses a full half wave, so it eases in and out and has a wide band of purples and orange/yellow.

```auto
h3 = wave(h/2 + .75)

```

![mod2 hsv](https://forum.electromage.com/uploads/default/original/1X/34af3ab644b5ef3bbc163232fdd182772ddf399e.png)

---

_[View the full topic](https://forum.electromage.com/t/color-palette-support/192)._
