Skip to content

Commit 56635c5

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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/colors.py

Lines 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)