contour_demo problem

When running with the Cairo backend I get:
  File "matplotlib/", line 338, in draw
    for a in self.axes: a.draw(renderer)
  File "matplotlib/", line 1307, in draw
  File "matplotlib/", line 181, in draw
  File "matplotlib/", line 266, in draw
    gc.set_foreground(self._color) # problem
  File "/matplotlib/backends/", line 421, in set_foreground
TypeError: Context.set_rgb_color() takes exactly 3 arguments (4 given)

It looks to like the frontend ( is working with rgba colors
and passing the rgba color to the backend which is expecting rgb color.

colors.colorConverter.to_rgb(fg) is also a problem because for rgba input
it returns rgba not rgb.

One solution would be to change the last lines of colorConverter.to_rgb(fg)
        self.cache[arg] = color
        return color
  color = color[0:3]
        self.cache[arg] = color
        return color
To ensure that to_rgb() actually gives rgb and not rgba.
What do you think?