I know this list of colors that matplotlib support:
https://pythonhosted.org/ete2/reference/reference_svgcolors.html
Is there a programmatic way to convert this names to hex ?
I would like a function that receive the color name and return the hex value of this color.
Thanks.
matplotlib.colors.cnames
is a dictionary of all of matplotlib's colors and their hex values:
import matplotlib
print(matplotlib.colors.cnames["blue"])
--> u'#0000FF'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With