You are reading an old version of the documentation (v2.1.1). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.to_hex.html
matplotlib
Fork me on GitHub


Travis-CI:

This Page

matplotlib.colors.to_hex

matplotlib.colors.to_hex(c, keep_alpha=False)

Convert c to a hex color.

Uses the #rrggbb format if keep_alpha is False (the default), #rrggbbaa otherwise.