On this page
matplotlib.colors.to_hex
matplotlib.colors.to_hex(c, keep_alpha=False)-
Convert
cto a hex color.Uses the #rrggbb format if
keep_alphais False (the default),#rrggbbaaotherwise.
© 2012–2017 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
http://matplotlib.org/2.1.0/api/_as_gen/matplotlib.colors.to_hex.html