Thanks to visit codestin.com Credit goes to github.com
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 f5e2ca5 commit 2d392cdCopy full SHA for 2d392cd
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