# Blinkfade - limiting hue palette

**URL:** <https://forum.electromage.com/t/blinkfade-limiting-hue-palette/1073>\
**Category:** Patterns and Code\
**Created:** [March 15, 2021, 7:19am UTC](https://forum.electromage.com/t/blinkfade-limiting-hue-palette/1073 "2021-03-15T07:19:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emdeex](https://forum.electromage.com/user_avatar/forum.electromage.com/emdeex/32/765_2.png) [@emdeex](https://forum.electromage.com/u/emdeex)\
**Post date:** [March 15, 2021, 7:19am UTC](https://forum.electromage.com/t/blinkfade-limiting-hue-palette/1073/1 "2021-03-15T07:19:07Z")

</div>

Hi All,

Hoping I could get some code tips here; I’m looking at Blinkfade (sound reactive)… and I can see its choosing hues from a rotating palette.

Any ideas on how I could restrict the palette … or ignore certain hues ?

```
  /*
    The reinitialized pixel's color will be selected from a rotating 
    pallette. The base hue cycles through the hue wheel every 4.6 seconds.
    Then, up to 20% hue variation is added based on the loudest frequency
    present. More varied sound produces more varied colors.
  */
  hues[i] = time(.07) + .2 * triangle(_maxFrequency / 1000)
```

---

<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:** [March 15, 2021, 5:21pm UTC](https://forum.electromage.com/t/blinkfade-limiting-hue-palette/1073/2 "2021-03-15T17:21:16Z")

</div>

Hi @emdeex,  
Check out this article on doing all kinds of fancy things with hue:

> [@Working with Hues in Pixelblaze - color ranges, blending](https://forum.electromage.com/t/working-with-hues-in-pixelblaze-color-ranges-blending/687):
>
> Rainbows are great, but what if you want to limit something to a color range with in the spectrum? Color Ranges To limit something to a hue within a range, first I find the boundary colors I’m looking for. You can picture the hue as a color wheel like this: [colorwheel] Red, green, and blue happen at thirds of the wheel, with red at 0, green at 1/3, and blue and 2/3. To fix a number within a range that represents a hue range, you have to scale and offset it accordingly. You could do this wit…

While you may not need the later blending stuff, the first part should help you limit it to a subset of the spectrum.
