We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2e34f38 + 143c30e commit 20170d7Copy full SHA for 20170d7
lib/matplotlib/colors.py
@@ -390,8 +390,17 @@ def to_hex(c, keep_alpha=False):
390
"""
391
Convert *c* to a hex color.
392
393
- Uses the ``#rrggbb`` format if *keep_alpha* is False (the default),
394
- ``#rrggbbaa`` otherwise.
+ Parameters
+ ----------
395
+ c : :doc:`color </tutorials/colors/colors>` or `numpy.ma.masked`
396
+
397
+ keep_alpha: bool, default: False
398
+ If False, use the ``#rrggbb`` format, otherwise use ``#rrggbbaa``.
399
400
+ Returns
401
+ -------
402
+ str
403
+ ``#rrggbb`` or ``#rrggbbaa`` hex color string
404
405
c = to_rgba(c)
406
if not keep_alpha:
0 commit comments