#NEWLINE# def _flatten_palettes( palettes ) : #NEWLINE# #INDENT# 'Convert palette mappings into color list.' #NEWLINE# flattened = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# palettes = _merge_palettes ( palettes ) #NEWLINE# for palette in palettes : #NEWLINE# #INDENT# flat = [ i for sub in palettes [ palette ] . values ( ) for i in sub ] #NEWLINE# flattened . update ( { #NEWLINE# #INDENT# flat : flat , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return flattened