You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.0.0b1.post7580.dev0+ge487118
matplotlib
Fork me on GitHub

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.