function showPalette(palette)

nr_colors = size(palette, 1);
rows = ceil(sqrt(nr_colors));
cols = ceil(nr_colors / rows);

if rows*cols > nr_colors
    palette = [palette, zeros(rows*cols - nr_colors, 3)];
end
palette_img = reshape(palette, rows, cols, 3);
palette_img = imresize(palette_img, 16, 'nearest');
figure, imshow(palette_img);

