def rgb2hex(rgb):
 return ('#%02x%02x%02x' % tuple([round((val * 255)) for val in rgb]))

def rgb2hex ( rgb ) : return ( '#%02x%02x%02x' % tuple ( [ round ( ( val * 255 ) ) for val in rgb ] ) )
given a len 3 rgb tuple of 0-1 floats .