You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It assumes that any color specified as a string doesn't have an alpha channel. This is outdated, because hex strings that contain alpha values are permitted.
It assumes that tuples indicating the color and the alpha don't have alpha channels. This is because it assumes that the length has to be 4 for a non-string with an alpha channel.
I can imagine a few fixes, but the code for creating an RGBA array from a color is a bit opaque to me. Also, the method is currently only used in lib/matplotlib/axis.py for the Tick class and in lib/matplotlib/test_colors.py. So maybe it's not that important, but it could be more useful if more flexible and accurate.
Motivation:
The motivation for this bug issue is the context where the alpha value should be set to a default value if the alpha is not provided by the user. This context would benefit greatly from a method that accurately determines whether a color or a sequence of colors have alpha values.
Operating system
OS/X
Matplotlib Version
3.9.0.dev687+g4099a45ee5
Matplotlib Backend
MacOSX
Python version
3.10.12
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Bug summary
In matplotlib.colors._has_alpha_channel, it fails to identify colors with alpha channels in two contexts.
Code for reproduction
Actual outcome
Expected outcome
Additional information
I can imagine a few fixes, but the code for creating an RGBA array from a color is a bit opaque to me. Also, the method is currently only used in lib/matplotlib/axis.py for the Tick class and in lib/matplotlib/test_colors.py. So maybe it's not that important, but it could be more useful if more flexible and accurate.
Motivation:
The motivation for this bug issue is the context where the alpha value should be set to a default value if the alpha is not provided by the user. This context would benefit greatly from a method that accurately determines whether a color or a sequence of colors have alpha values.
Operating system
OS/X
Matplotlib Version
3.9.0.dev687+g4099a45ee5
Matplotlib Backend
MacOSX
Python version
3.10.12
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: