from matplotlib.colors import ListedColormap

cm3 = ListedColormap(['#0000aa', '#ff2020', '#50ff50'])
cm2 = ListedColormap(['#0000aa', '#ff2020'])

[((52, 101), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#0000aa', '#ff2020', '#50ff50']"], {}), "(['#0000aa', '#ff2020', '#50ff50'])\n", (66, 101), False, 'from matplotlib.colors import ListedColormap\n'), ((108, 146), 'matplotlib.colors.ListedColormap', 'ListedColormap', (["['#0000aa', '#ff2020']"], {}), "(['#0000aa', '#ff2020'])\n", (122, 146), False, 'from matplotlib.colors import ListedColormap\n')]