Skip to content

Commit

Permalink
style: added disabled colors for custom palette
Browse files Browse the repository at this point in the history
  • Loading branch information
ElpadoCan committed Jun 12, 2023
1 parent e03f5ca commit 1d6028a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cellacdc/_palettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ def _light_colors():
}
return colors

def _light_disabled_colors():
disabled_colors = {
'ButtonText': (128, 128, 128, 255),
'WindowText': (128, 128, 128, 255),
'Text': (128, 128, 128, 255),
'Light': (53, 53, 53, 255)
}
return disabled_colors

def _dark_disabled_colors():
disabled_colors = {
'ButtonText': (128, 128, 128, 255),
'WindowText': (128, 128, 128, 255),
'Text': (128, 128, 128, 255),
'Light': (53, 53, 53, 255)
}
return disabled_colors

def _dark_colors():
colors = {
'Window': (50, 50, 50, 255),
Expand All @@ -39,11 +57,17 @@ def _dark_colors():
def getPaletteColorScheme(palette: QtGui.QPalette, scheme='light'):
if scheme == 'light':
colors = _light_colors()
disabled_colors = _light_disabled_colors()
else:
colors = _dark_colors()
disabled_colors = _dark_disabled_colors()
for role, rgba in colors.items():
colorRole = getattr(QtGui.QPalette, role)
palette.setColor(colorRole, QtGui.QColor(*rgba))
ColorGroup = QtGui.QPalette.Disabled
for role, rgba in disabled_colors.items():
colorRole = getattr(QtGui.QPalette, role)
palette.setColor(ColorGroup, colorRole, QtGui.QColor(*rgba))
return palette


0 comments on commit 1d6028a

Please sign in to comment.