def get_definition_from_renderer(renderer):
config = {<EOL>'<STR_LIT>': [[x[<NUM_LIT:0>], x[<NUM_LIT:1>].to_hex()] for x in renderer.colormap],<EOL>'<STR_LIT>': {}<EOL>}<EOL>if renderer.fill_value:<EOL><INDENT>config['<STR_LIT>']['<STR_LIT>'] = renderer.fill_value<EOL><DEDENT>if isinstance(renderer, StretchedRenderer):<EOL><INDENT>config['<STR_LIT:type>'] = '<STR_LIT>'<EOL>config['<STR_LIT>']['<STR_LIT>'] = renderer.colorspace<EOL><DEDENT>elif isinstance(renderer, UniqueValuesRenderer):<EOL><INDENT>config['<STR_LIT:type>'] = '<STR_LIT>'<EOL>if renderer.labels:<EOL><INDENT>config['<STR_LIT>']['<STR_LIT>'] = renderer.labels<EOL><DEDENT><DEDENT>elif isinstance(renderer, ClassifiedRenderer):<EOL><INDENT>config['<STR_LIT:type>'] = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(renderer.__class__.__name__))<EOL><DEDENT>return config<EOL>
Returns a dictionary definition of the given renderer