Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdfc5adf

Browse files
authored
Merge pull request#21064 from meeseeksmachine/auto-backport-of-pr-20913-on-v3.5.x
Backport PR#20913 on branch v3.5.x ([Doc] colors.to_hex input & output)
2 parentsf5e2ca5 +2d392cd commitdfc5adf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎lib/matplotlib/colors.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,17 @@ 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 `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
395404
"""
396405
c=to_rgba(c)
397406
ifnotkeep_alpha:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp