def gen_colors(img):
magick_command = has_im()<EOL>for i in range(<NUM_LIT:0>, <NUM_LIT:20>, <NUM_LIT:1>):<EOL><INDENT>raw_colors = imagemagick(<NUM_LIT:16> + i, img, magick_command)<EOL>if len(raw_colors) > <NUM_LIT:16>:<EOL><INDENT>break<EOL><DEDENT>elif i == <NUM_LIT>:<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:16> + i)<EOL><DEDENT><DEDENT>return [re.search("<STR_LIT>", str(col)).group(<NUM_LIT:0>) for col in raw_colors[<NUM_LIT:1>:]]<EOL>
Format the output from imagemagick into a list
       of hex colors.