Bug summary
I noticed in a screenshot from another PR that out of the six backends displayed, only the Qt5Agg icon fails to adapt to dark mode. It remains black and blends in with the background, making it difficult to distinguish.
#30554 (comment)
I believe the issue lies in the following code:
if self.palette().color(self.backgroundRole()).value() < 128:
icon_color = self.palette().color(self.foregroundRole())
mask = pm.createMaskFromColor(
QtGui.QColor('black'),
QtCore.Qt.MaskMode.MaskOutColor)
pm.fill(icon_color)
pm.setMask(mask)
It appears the icon is rendered as black regardless of whether the if condition is met. This is likely caused by the line mask = pm.createMaskFromColor(QtGui.QColor('black'), QtCore.Qt.MaskMode.MaskOutColor).
Code for reproduction
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Qt5Agg')
fig, ax = plt.subplots(subplot_kw = {"projection" : "3d"})
ax.bar3d([1, 1, 2, 2], [1, 2, 1, 2], 0, 1, 1, [2, 3, 1, 4], axlim_clip=True)
plt.show()
Actual outcome
Expected outcome
Additional information
No response
Operating system
MacOS
Matplotlib Version
3.11.0
Matplotlib Backend
Qt5Agg
Python version
No response
Jupyter version
No response
Installation
None
Bug summary
I noticed in a screenshot from another PR that out of the six backends displayed, only the Qt5Agg icon fails to adapt to dark mode. It remains black and blends in with the background, making it difficult to distinguish.
#30554 (comment)
I believe the issue lies in the following code:
It appears the icon is rendered as black regardless of whether the
ifcondition is met. This is likely caused by the linemask = pm.createMaskFromColor(QtGui.QColor('black'), QtCore.Qt.MaskMode.MaskOutColor).Code for reproduction
Actual outcome
Expected outcome
Additional information
No response
Operating system
MacOS
Matplotlib Version
3.11.0
Matplotlib Backend
Qt5Agg
Python version
No response
Jupyter version
No response
Installation
None