def pop_legacy_palette(kwds, *color_defaults):
palette = kwds.pop('<STR_LIT>', None)<EOL>if palette:<EOL><INDENT>legacy = [k for k, _ in color_defaults if k in kwds]<EOL>if legacy:<EOL><INDENT>raise ValueError('<STR_LIT>' + '<STR_LIT:U+002CU+0020>'.join(legacy))<EOL><DEDENT>return palette<EOL><DEDENT>values = [kwds.pop(k, v) for k, v in color_defaults]<EOL>if values and color_defaults[<NUM_LIT:0>][<NUM_LIT:0>] in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>values = values[<NUM_LIT:0>]<EOL><DEDENT>return make.colors(values or None)<EOL>
Older animations in BPA and other areas use all sorts of different names for
what we are now representing with palettes.

This function mutates a kwds dictionary to remove these legacy fields and
extract a palette from it, which it returns.