#NEWLINE# def _distance_to_color( self , color ) : #NEWLINE# #INDENT# 'This computes the distance to a color, should be minimized.' #NEWLINE# rgb = ( int ( color [ 1 : 3 ] , 16 ) , int ( color [ 3 : 5 ] , 16 ) , int ( color [ 5 : 7 ] , 16 ) ) #NEWLINE# return ( ( ( ( self . r - rgb [ 0 ] ) ** 2 ) + ( ( self . g - rgb [ 1 ] ) ** 2 ) ) + ( ( rgb . b - rgb [ 2 ] ) ** 2 ) )