color function in matplotlib code example
Example: matplotlib convert color string to int
from matplotlib.colors import CSS4_COLORS, to_rgb
# Convert the color 'red' to rgb format:
c = to_rgb(CSS4_COLORS["red"]) # c = (1, 0, 0)
# For all available colors go to:
# https://matplotlib.org/3.3.1/gallery/color/named_colors.html#sphx-glr-gallery-color-named-colors-py