Can anybody tell me what is wrong with this?

Can anybody tell me what is wrong with this? I call the following line from the main loop but it doesn’t seem to want to change from the black palette I start with. Pretty sure I’m getting something fundamental wrong.
I’m using palette blending BTW.

SetupWarmWhitePalette(targetPalette1);

void SetupWarmWhitePalette(CRGBPalette16 palette)
{
fill_solid( palette, 16, CRGB(255, 220, 120));
palette[0] = CRGB::White;
palette[4] = CRGB::Orange;
palette[8] = CRGB::Orange;
palette[12] = CRGB::White;

}

Full code - https://codebender.cc/sketch:91941

Change the function definition to this:

void SetupWarmWhitePalette(CRGBPalette16 & palette)

What you have up there basically makes a copy of the palette to pass it into the function - so you are changing a copy. Meanwhile, this is passing a reference to your palette, so your changes will make it out of the function :slight_smile:

Thanks, have been struggling with this for some time. I tend to have a general idea how to do things but the finer details catch me out.