title: How to make a tkinter canvas rectangle transparent?
body: <p>I need to make my tkinter rectangles transparent. Does anyone know how to do that?</p>
  
  <p>I have tried to specify <code>alpha=".5", opacity=".5"</code>, and I have tried to add two more digits in the end of the color code: <code>fill="#ff000066"</code>. None of these things seem to work, I can't find the right syntax.</p>
  
  <pre><code>import tkinter
  
  root = tkinter.Tk()
  canvas = tkinter.Canvas(root, width=800, height=600)
  canvas.pack()
  
  canvas.create_rectangle(50, 50, 100, 100, fill="#ff0000", alpha=0.5)
  
  root.mainloop()
  </code></pre>
  
  <p>This code gives me this message: <code>_tkinter.TclError: unknown option "-alpha"</code>, so this is obviously not the right way to do it.</p>