from pprint import pprint colors = [] for r in range(0, 8): for g in range(0, 8): for b in range(0, 4): colors.append([ int(round(r * 36.428571429)), int(round(g * 36.428571429)), b * 85 ]) pprint(colors) print(len(colors)) # Create a simple html overview of the palette with open('palette.html', 'w') as f: f.write('') for i, c in enumerate(colors): if i and not (i % 32): f.write('
\n') f.write('{i}\n'.format( r=c[0], g=c[1], b=c[2], i=i) ) f.write('

\n') for i, c in enumerate(colors): f.write('
{i}: {r}, {g}, {b}
\n'.format(r=c[0], g=c[1], b=c[2], i=i)) f.write('') with open('../standard_palette.h', 'w') as f: f.write('#include "color.h"\n\n') f.write('static const Palette standard_palette = {\n'); f.write(",\n".join(['\t{{{r}, {r}, {b}}}'.format(r=c[0], g=c[1], b=c[2]) for c in colors])) f.write("\n};")