Hello everyone, I am currently using version 3.1 with a strip of neopixels (not

Hello everyone,

I am currently using version 3.1 with a strip of neopixels (not sure if its the WS2811 or WS2812 as changing the FastLED.addLeds works for all 3 options). I am currently working on a project that is going to use a custom color palette which is here
DEFINE_GRADIENT_PALETTE(sunSet) {
0, 255, 255, 255, //white
50, 128, 128, 225, //purplely blue
75, 0, 0, 255, //blue
165, 255, 128, 0, //red/orangeish
255, 255, 0, 0 //red
};

I would like it to start at white and end at red, however during my tests it seems to wrap back around to the beginning around the time my index is ~240 when using this function ColorFromPalette(myPal, index); Is there any way to stop this from warping and kind of latch it to red once it gets to the index 255?

Palettes automatically act like infinite loops, blending all the way around.

You’re exactly righty about 240 being the last nonblended point of red there.

Here’s what I do:

c = ColorFromPalette( pal, scale8( index, 240) );

That scales index down To keep it in the non-wrapping part of the palette. There are other options, too, but this is often the easiest.

Ahh. OK thanks for the input! Can you give me some of the other options that you mentioned? Also is there anyway that I could possibly extend the 240 closer to 255, maybe get it up to 145 or so?