Skip to content

Commit d733dbc

Browse files
committed
try fixing icon appearance on bright background
1 parent 7ce1044 commit d733dbc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/gui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ def __init__(self, conf, engine):
213213

214214
# Toolbar
215215
toolbar = self.CreateToolBar()
216-
217-
repl = b'#ffffff' if wx.SystemSettings.GetAppearance().IsDark() \
218-
else b'#000000'
216+
bg = toolbar.GetBackgroundColour()
217+
l = bg[0]/255.0 * 0.213 + bg[1]/255.0 * 0.715 + bg[2]/255.0 * 0.072
218+
repl = b'#ffffff' if l < 0.5 else b'#000000'
219219
d = Path(__file__).resolve().parent.parent / 'icons'
220220
sz = wx.Size(32, 32)
221221
def svg(pth):

0 commit comments

Comments
 (0)