f = figure ("toolbar", "none");
t = uitoolbar (f);

%% Try 16 different sizes
for i=8:8:128

  %% Create gridded image with black squares separated by white lines
  img = zeros (i, i, 3, "uint8");
  img (1:8:end, :, :) = 255;
  img (:, 1:8:end, :) = 255;
 
  %% Color each 8x8 square on diagonal differently
  for j = 1:(i/8)
    idx = (8*(j-1)) + (1:8);
    img (idx, idx, :) = 256 - 256/(i/8) * (j-1); 
  endfor

  b = uitoggletool (t, "cdata", img);
end
