8000
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.
1 parent b600026 commit 58e8b94Copy full SHA for 58e8b94
lib/matplotlib/colors.py
@@ -390,8 +390,18 @@ 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 ``np.ma.masked``
396
+
397
+ keep_alpha: bool, optional
398
+ Uses the ``#rrggbb`` format if *keep_alpha* is False (the default),
399
+ otherwise uses ``#rrggbbaa``.
400
401
+ Returns
402
+ -------
403
+ str
404
+ ``#rrggbb`` or ``#rrggbbaa`` hex color string
405
406
c = to_rgba(c)
407
if not keep_alpha:
0 commit comments