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

Appearance settings

Commit 56635c5

Browse filesBrowse files
committed
Merge pull request #7548 from anntzer/clarify-to_rgba-docstring
DOC: Clarify to_rgba docstring.
1 parent 0289b4f commit 56635c5
Copy full SHA for 56635c5

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎lib/matplotlib/colors.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colors.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def is_color_like(c):
121121
def to_rgba(c, alpha=None):
122122
"""Convert `c` to an RGBA color.
123123
124-
If `alpha` is not `None`, it forces the alpha value.
124+
If `alpha` is not `None`, it forces the alpha value, except if `c` is
125+
"none" (case-insensitive), which always maps to `(0, 0, 0, 0)`.
125126
"""
126127
# Special-case nth color syntax because it should not be cached.
127128
if _is_nth_color(c):
@@ -143,7 +144,8 @@ def to_rgba(c, alpha=None):
143144
def _to_rgba_no_colorcycle(c, alpha=None):
144145
"""Convert `c` to an RGBA color, with no support for color-cycle syntax.
145146
146-
If `alpha` is not `None`, it forces the alpha value.
147+
If `alpha` is not `None`, it forces the alpha value, except if `c` is
148+
"none" (case-insensitive), which always maps to `(0, 0, 0, 0)`.
147149
"""
148150
orig_c = c
149151
if isinstance(c, six.string_types):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.