Is there a way to have a palette with only 5 colors and not

Is there a way to have a palette with only 5 colors and not have any weird issues? Getting an early start on my outside Christmas lights and want to use the Retro C9 palette from Mark’s TwinkleFox code to mimic the retro c9 lights. Only problem is I don’t want any twinkling/flashing for this particular pattern.

I just want a nice solid old school looking string of lights depending on my mood. I modified the palette to only have the 5 colors but some LEDs don’t light up or there is a repeating color.

Or is a palette not the way to go for something like this? I was hoping to use fill_palette and not have to program each LED.

Monty Python and the holy hand grenade comes to mind here. The number shall be 4 (or 16) . . . . no more, no less. . .

I’d probably define a palette with 16. There would be 5 sets of 3, with black at the end. I’d also use NOBLEND (instead of LINEARBLEND), and I’d adjust the distance to match the number of pixels in use.

Thanks @Andrew_Tuline That’s pretty much what I was thinking as soon as I submitted the post. I ended using my brain for a few minutes and decided to do some simple for loops. Works great and looks great.

I know we shouldn’t post code here but it’s a small enough snippet that I’ll take the risk of getting yelled at.

for(int i = 0; i < NUM_LEDS -1; i += 5) {
leds[i] = C9_Red;
}
for(int i = 1; i <NUM_LEDS -1; i += 5) {
leds[i] = C9_Orange;
}
for(int i = 2; i <NUM_LEDS -1; i += 5) {
leds[i] = C9_Green;
}
for(int i = 3; i <NUM_LEDS -1; i += 5) {
leds[i] = C9_Blue;
}
for(int i = 4; i <NUM_LEDS -1; i += 5) {
leds[i] = C9_White;
}

Brian… got another dix you might consider… 1 for loop and then leds [i] = color; leds [i+1] = color2, leds [i+2]= color 3… ect… that way only one loop needed…

@John_Sullivan Thanks for the tip. That works great too.

@Brian_Lewis Looks like a good solution.