-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
dark_palette.py
74 lines (65 loc) · 2.91 KB
/
dark_palette.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# dark palette
# related document: https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtgui/qpalette.html
from PyQt6.QtGui import QPalette, QColor
_palette_dark = QPalette()
whiteColor = QColor("#fefefe") # 255 will become black due to bug in PyQt6>=6.2.3
subtleBlueColor = QColor(
"#8ab4f7"
) # add little blue highlight, make button clear it's clickable
_palette_dark.setColor(QPalette.ColorRole.Window, QColor(25, 25, 25))
_palette_dark.setColor(QPalette.ColorRole.WindowText, whiteColor)
_palette_dark.setColor(QPalette.ColorRole.Base, QColor(5, 5, 5))
_palette_dark.setColor(QPalette.ColorRole.AlternateBase, QColor(10, 10, 10))
_palette_dark.setColor(QPalette.ColorRole.ToolTipBase, QColor(0, 0, 0))
_palette_dark.setColor(QPalette.ColorRole.ToolTipText, whiteColor)
_palette_dark.setColor(QPalette.ColorRole.Text, whiteColor)
_palette_dark.setColor(QPalette.ColorRole.Button, QColor(20, 20, 20))
_palette_dark.setColor(QPalette.ColorRole.ButtonText, subtleBlueColor)
_palette_dark.setColor(QPalette.ColorRole.BrightText, whiteColor)
_palette_dark.setColor(QPalette.ColorRole.Link, QColor(42, 130, 218))
_palette_dark.setColor(QPalette.ColorRole.Highlight, subtleBlueColor)
_palette_dark.setColor(QPalette.ColorRole.HighlightedText, whiteColor)
if hasattr(QPalette.ColorRole, "Foreground"):
_palette_dark.setColor(QPalette.ColorRole.Foreground, QColor(25, 25, 25))
if hasattr(QPalette.ColorRole, "PlaceholderText"):
_palette_dark.setColor(QPalette.ColorRole.PlaceholderText, QColor(180, 180, 180))
_palette_dark.setColor(
QPalette.ColorRole.Light, QColor(25, 25, 25)
) # lighter than button color
_palette_dark.setColor(
QPalette.ColorRole.Midlight, QColor(30, 30, 30)
) # Between Button and Light
_palette_dark.setColor(
QPalette.ColorRole.Dark, QColor(228, 228, 228)
) # Darker than Button
_palette_dark.setColor(
QPalette.ColorRole.Mid, QColor(63, 63, 63)
) # Between Button and Dark
_palette_dark.setColor(
QPalette.ColorRole.Shadow, QColor(63, 63, 63)
) # A very dark color. By default, the shadow color is Qt::black.
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.WindowText, QColor("#697177")
)
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.Text, QColor("#697177")
)
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.ButtonText, QColor("#3f4042")
)
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.Highlight, QColor("#53575b")
)
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.HighlightedText, QColor("#697177")
)
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.Link, QColor("#697177")
)
_palette_dark.setColor(
QPalette.ColorGroup.Disabled, QPalette.ColorRole.LinkVisited, QColor("#697177")
)
_palette_dark.setColor(
QPalette.ColorGroup.Inactive, QPalette.ColorRole.Highlight, QColor("#393d41")
)
PALETTE_DARK = _palette_dark