for a greyscale palette use the same values for r,g & b.
Example :
for (i=0; i< 64; i++) pal[i] = rgb(i*4, i*4, i*4);