matplotlib.colors.to_hex#

matplotlib.colors.to_hex(c,keep_alpha=False)[source]#

Convertc to a hex color.

Parameters:
ccolor ornumpy.ma.masked
keep_alphabool, default: False

If False, use the#rrggbb format, otherwise use#rrggbbaa.

Returns:
str

#rrggbb or#rrggbbaa hex color string

On this page