def print_color_palette(pal):
    """Prints a list of colors to stdout."""
    for stoq in pal:
        fg_color = pal.name(stoq, fg=True)
        bg_color = pal.name(stoq)
        rgb = '(%3.3d, %3.3d, %3.3d)' % pal.rgb(stoq)
        hx = pal.hex(stoq)
        print('%7s %5s on %13s %15s #%s' % (stoq, fg_color, bg_color, rgb, hx))
