title: Convert numpy array of RGB values to hex using format operator %
body: <p>Following on this SO <a href="https://stackoverflow.com/questions/3380726/converting-a-rgb-color-tuple-to-a-six-digit-code-in-python">question</a> what would be the best way to use the formatting operator to apply it to a numpy array where the array is of the format given below corresponding to RGB values</p>
  
  <blockquote>
    <p>Note RGB values have been scaled 0 to 1 so multiple by 255 to rescale</p>
  </blockquote>
  
  <pre><code>array([[ 0.40929448,  0.47071505,  0.27701891],
         [ 0.59383913,  0.60611158,  0.55329837],
         [ 0.4393785 ,  0.4276561 ,  0.34999225],
         [ 0.4159481 ,  0.4516056 ,  0.3026519 ],
         [ 0.54449997,  0.36963636,  0.4001209 ],
         [ 0.36970012,  0.3145826 ,  0.315974  ]])
  </code></pre>
  
  <p>and you want a <a href="https://en.m.wikipedia.org/wiki/Web_colors#Hex_triplet" rel="nofollow noreferrer">hex triplet</a> value for each row</p>