Adding nbColorsPerPalette function. When setting a palette, resize the vector if its size is wrong.
Tim collect.