I experienced the same problem. The cause of the problem is that the color tuple is being interpreted as data, which of course is what neither you nor I want. The workaround is to convert the color tuple to a color string.
from matplotlib.colors import to_hex # convert to hex string
if not isinstance(color, str):
color = to_hex(color)
In your case, include the import. Then change data append line:
data.append(to_hex(color))