I want to use `fill_palette`, but I am not sure,

(Christoph Wempe) #1

I want to use fill_palette, but I am not sure, what the “incIndex” parameter actually does. Or how it works.

I cannot find a good documentation about this function.
Only one line at http://fastled.io/docs/3.1/group___colorutils.html#gad6431776a18268d286d146158e25cb36

I played around, but all I could find out was that the palette is shortened if I use a low value for incIndex and the palette get streched beyond my strip if I use a higher value.

But how is this calculated.
That value do I need to fit the palette perfectly on my led strip?

(Jason Coon) #2

incIndex is just how many color palette steps get skipped between each LED: https://github.com/FastLED/FastLED/blob/master/colorutils.h#L1562

higher = narrower stripes

An example: https://gist.github.com/kriegsman/981cc6f501d30dfd82a7

(Ken White) #3

@Christoph_Wempe - As Jason pointed out, you should see lines 1554 to 1564 in

You can see that the fill_palette function contains the ColorFromPalette function. Look at @marmil ’s excellent explanation for the index in the ColorFromPalette function in the responses section of the following post:

(Christoph Wempe) #4

Now I understand how it works.