1from matplotlib.colors import CSS4_COLORS, to_rgb
2
3# Convert the color 'red' to rgb format:
4c = to_rgb(CSS4_COLORS["red"]) # c = (1, 0, 0)
5
6# For all available colors go to:
7# https://matplotlib.org/3.3.1/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py