title: Python from color name to RGB
body: <p>If I have a <code>function</code> which takes <code>color</code> as an input to be edited first (by RGB numbers), and then used in <code>matplotlib.pyplot</code>. How can I convert color name to RGB?</p>
  <p>For example:</p>
  <pre><code>def function(color):
       color[3] = 0.5
       plt.plot([1,2],[2,4], color = color)
  </code></pre>
  <p>then <code>function((0,0,1,1))</code> works, but <code>function('blue')</code> will only work on the <code>plt.plot</code>.</p>
  <p>How can I convert color name to RGB, (such as <code>blue</code> to <code>(0,0,1,1)</code>)?</p>