def gen_colors(img):
color_cmd = ColorThief(img).get_palette<EOL>for i in range(<NUM_LIT:0>, <NUM_LIT:10>, <NUM_LIT:1>):<EOL><INDENT>raw_colors = color_cmd(color_count=<NUM_LIT:8> + i)<EOL>if len(raw_colors) >= <NUM_LIT:8>:<EOL><INDENT>break<EOL><DEDENT>elif i == <NUM_LIT:10>:<EOL><INDENT>logging.error("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>logging.warning("<STR_LIT>")<EOL>logging.warning("<STR_LIT>", <NUM_LIT:8> + i)<EOL><DEDENT><DEDENT>return [util.rgb_to_hex(color) for color in raw_colors]<EOL>
Loop until 16 colors are generated.