#NEWLINE# def convert( self , hexcolor ) : #NEWLINE# #INDENT# diffs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( xterm , rgb ) in self . colors . items ( ) : #NEWLINE# #INDENT# diffs [ _diff ( rgb , minDiffAnsi ) ] = xterm #NEWLINE# #UNINDENT# minDiffAnsi = diffs [ min ( diffs . keys ( ) ) ] #NEWLINE# return ( minDiffAnsi , self . colors [ minDiffAnsi ] )