I have a strange issue.

I have a strange issue.

I defined a gradient palette:

DEFINE_GRADIENT_PALETTE( thk_gp ) {
0, 255, 0, 0,
127, 255, 63, 0,
255, 255, 0, 255};

I use fill_solid() to show one color of this palette on the whole strip.
This runes from 0 to 255 and back to 0 and so forth.

But when I reach the end of the palette (index: ~255) it changes the color for a short moment to ~rgb(255,0,0) instead of staying at ~rgb(255,0,255).

See debug of the palette:
[DEBUG] thk_gp 238 255 1 250
[DEBUG] thk_gp 239 255 0 252
[DEBUG] thk_gp 240 255 0 254
[DEBUG] thk_gp 241 255 0 238
[DEBUG] thk_gp 242 255 0 222
[DEBUG] thk_gp 243 255 0 206
[DEBUG] thk_gp 244 255 0 190
[DEBUG] thk_gp 245 255 0 174
[DEBUG] thk_gp 246 255 0 158
[DEBUG] thk_gp 247 255 0 142
[DEBUG] thk_gp 248 255 0 127
[DEBUG] thk_gp 249 255 0 111
[DEBUG] thk_gp 250 255 0 95
[DEBUG] thk_gp 251 255 0 79
[DEBUG] thk_gp 252 255 0 63
[DEBUG] thk_gp 253 255 0 47
[DEBUG] thk_gp 254 255 0 31

I found out this has to do with the fast that I did not define the blend-type in ColorFromPalette().
So I added “, NOBLEND”.
Looks good at the first sight.

But now the transition from one color to the next is not smooth anymore.
I guess this is because currentPalette is CRGBPalette16.

But is defining currentPalette as CRGBPalette256 the solution?
Or how can I use LINEABLEND without getting the wrong color at the end of the palette?

Use linear blend and stop at 240 rather than 255?

More info here:
https://github.com/FastLED/FastLED/issues/515
https://github.com/FastLED/FastLED/issues/515

Thanks.
I am using 240 as maximum now.
Looks great. :slight_smile: