Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify comment explanation
  • Loading branch information
landoskape committed Nov 15, 2023
commit 77e759f08e06b1de1d9e390d480f1d434aca203d
3 changes: 2 additions & 1 deletion lib/matplotlib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ def _has_alpha_channel(c):
# example: [0.5, 0.5, 0.5, 0.5]
return True

# if it has length 2, the 2nd element isn't None, and the 1st element has len=3
# if it has length 2, it's a color/alpha tuple
# if the second element isn't None or the first element has length = 4
if len(c) == 2 and (c[1] is not None or len(c[0]) == 4):
Comment thread
landoskape marked this conversation as resolved.
Outdated
# example: ([0.5, 0.5, 0.5, 0.5], None) or ('r', 0.5)
return True
Expand Down