8000 numpydoc style parameters and link to colors tutorial for colors.to_hex · matplotlib/matplotlib@58e8b94 · GitHub
[go: up one dir, main page]

Skip to content

Commit 58e8b94

Browse files
committed
numpydoc style parameters and link to colors tutorial for colors.to_hex
1 parent b600026 commit 58e8b94

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/matplotlib/colors.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,18 @@ def to_hex(c, keep_alpha=False):
390390
"""
391391
Convert *c* to a hex color.
392392
393-
Uses the ``#rrggbb`` format if *keep_alpha* is False (the default),
394-
``#rrggbbaa`` otherwise.
393+
Parameters
394+
----------
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
395405
"""
396406
c = to_rgba(c)
397407
if not keep_alpha:

0 commit comments

Comments
 (0)
0