def color_name(data, bits):
 ret = ['#']
 for i in range(3):
  ret.append(('%02X' % (data[i] << (8 - bits[i]))))
 return ''.join(ret)

def color_name ( data , bits ) : ret = [ '#' ] for i in range ( 3 ) : ret . append ( ( '%02X' % ( data [ i ] << ( 8 - bits [ i ] ) ) ) ) return '' . join ( ret )
color names in #rrggbb format .