Hi, I want to use this palette: http://soliton.vm.bytemark.co.uk/pub/cpt-city/cb/div/tn/BrBG_03.png.index.html And I use this definition:

Hi,
I want to use this palette:
http://soliton.vm.bytemark.co.uk/pub/cpt-city/cb/div/tn/BrBG_03.png.index.html
And I use this definition:

DEFINE_GRADIENT_PALETTE( BrBG_03_gp ) {
0, 165,117, 25,
84, 165,117, 25,
84, 229,233,230,
170, 229,233,230,
170, 17,118, 95,
255, 17,118, 95};

when I print palette array with this code:
CRGB tt;
CRGBPalette16 myPal = BrBG_03_gp;
for(int index = 0; index < 256; index++)
{
tt=ColorFromPalette(myPal,index,BRIGHTNESS,NOBLEND);
Serial.print(index);
Serial.print(" ");

  Serial.print(tt.r);
  Serial.print(" ");
  Serial.print(tt.g);
  Serial.print(" ");
  Serial.println(tt.b);

}
I expect that the colors changed in index 84 and 170 but colors changed in index 112 and 192 !? What is the matter?

You have two different colors defined at same index point of 84, and also 170. Try changing the second 84 index point to 85 and second 170 to 171.

@marmil yes,I use PaletteKnife and get this index!!
See this:
http://fastled.io/tools/paletteknife/

Any help appreciated.

From the docs:
http://fastled.io/docs/3.1/colorutils_8h_source.html

"
Gradient palettes are loaded into CRGB16Palettes in such a way that, if possible, every color represented in the gradient palette is also represented in the CRGBPalette16.
For example, consider a gradient palette that is all black except for a single, one-element-wide (1/256th!) spike of red in the middle:
0, 0,0,0
124, 0,0,0
125, 255,0,0 // one 1/256th-palette-wide red stripe
126, 0,0,0
255, 0,0,0

A naive conversion of this 256-element palette to a 16-element palette might accidentally completely eliminate the red spike, rendering the palette completely black.

However, the conversions provided here would attempt to include a the red stripe in the output, more-or-less as faithfully as possible. So in this case, the resulting CRGBPalette16 palette would have a red stripe in the middle which was 1/16th of a palette wide – the narrowest possible in a CRGBPalette16.

This means that the relative width of stripes in a CRGBPalette16 will be, by definition, different from the widths in the gradient palette. This code attempts to preserve “all the colors”, rather than the exact stripe widths at the expense of dropping some colors.
"

This is why it’s not changing at the index you’re expecting. If you put the above example of a single stripe of red at 125 in your code you will see you end up with red from 144 to 159.

@marmil Very thanks, therefore for have high accuracy I must use CRGBPalette256