G = nx.Graph()
for color in 'bgrcmyk':
    G.add_edge('s' + color, 't' + color, color=color)
edges, colors = zip(*list(nx.get_edge_attributes(G, 'color').items()))
nx.draw(G, edgelist=edges, edge_color=colors, width=10)
plt.show()
Networkx: how to draw coloured edges?