Skip to content

Commit 6c0ca8a

Browse files
Merge pull request #72 from luisbocanegra/dev
Color scheme fixes
2 parents 7d05047 + a561ed1 commit 6c0ca8a

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

kde-material-you-colors

100644100755
File mode changed.

schemeconfigs.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
from color_utils import blendColors, contrast_ratio, hex2rgb, hex2alpha, scale_saturation, sort_colors_luminance, blend2contrast, lighteen_color
1+
from color_utils import blendColors, contrast_ratio, hex2rgb, hex2alpha, scale_lightness, scale_saturation, sort_colors_luminance, blend2contrast, lighteen_color
22
from utils import range_check, tup2str
33
class ThemeConfig:
44
def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_multiplier=1, toolbar_opacity=100):
55
if toolbar_opacity == None:
66
toolbar_opacity = 100
77
colors_best = colors['bestColors']
88
tones_primary = colors['palettes']['primaryTones']
9+
tones_secondary = colors['palettes']['secondaryTones']
910
tones_neutral = colors['palettes']['neutralTones']
1011
tones_tertiary = colors['palettes']['tertiaryTones']
1112
colors_light = colors['schemes']['light']
@@ -26,17 +27,15 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
2627

2728
# Blend some extra colors by factor left(0.0) to right(1.0)
2829
self._extras = {
29-
"SurfaceLight": blendColors(colors_light['surface'], colors_light['primary'], 0.05*lbm),
30-
"SurfaceDark": blendColors(tones_neutral[5], colors_dark['primary'], 0.08*dbm),
30+
"SurfaceLight": blendColors(colors_light['background'], tones_primary[70], 0.13*lbm),
31+
"SurfaceLight1": blendColors(colors_light['background'], tones_primary[70], .18*lbm),
32+
"SurfaceLight2": blendColors(colors_light['background'], tones_primary[70], .23*lbm),
33+
"SurfaceLight3": blendColors(colors_light['background'], tones_primary[70], .20*lbm),
3134

32-
"SurfaceLight1": blendColors(colors_light['background'], colors_light['primary'], .08*lbm),
33-
"SurfaceDark1": blendColors(colors_dark['background'], colors_dark['primary'], .05*dbm),
34-
35-
"SurfaceLight2": blendColors(colors_light['background'], colors_light['primary'], .11*lbm),
36-
"SurfaceDark2": blendColors(colors_dark['background'], colors_dark['primary'], .08*dbm),
37-
38-
"SurfaceLight3": blendColors(colors_light['background'], colors_light['primary'], .16*lbm),
39-
"SurfaceDark3": blendColors(colors_dark['background'], colors_dark['primary'], .08*dbm),
35+
"SurfaceDark": blendColors(tones_neutral[5], tones_primary[40], 0.08*dbm),
36+
"SurfaceDark1": blendColors(colors_dark['background'], tones_primary[40], .05*dbm),
37+
"SurfaceDark2": blendColors(colors_dark['background'], tones_primary[40], .08*dbm),
38+
"SurfaceDark3": blendColors(colors_dark['background'], tones_primary[40], .11*dbm),
4039

4140
"LinkOnPrimaryLight": blendColors(colors_light['onPrimary'], base_text_states['Link'], .5),
4241
"LinkVisitedOnPrimaryLight": blendColors(colors_light['onPrimary'], base_text_states['Visited'], .8),
@@ -61,13 +60,19 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
6160
"NegativeOnSurfaceDark": blendColors(colors_dark['onSurface'], base_text_states['Negative'], .8),
6261
"PositiveOnSurfaceDark": blendColors(colors_dark['onSurface'], base_text_states['Positive'], .8),
6362
"NeutralOnSurfaceDark": blendColors(colors_dark['onSurface'], base_text_states['Neutral'], .8),
64-
65-
"LightSelectionAlt": blendColors(colors_light['surface'], colors_light['secondary'], .02*lbm),
66-
"DarkSelectionAlt": blendColors(colors_dark['background'], colors_dark['secondary'], .3*dbm),
67-
6863
"LightSelectionAltActive": blendColors(colors_light['background'], colors_light['secondary'], .5),
6964
"DarkSelectionAltActive": blendColors(colors_dark['background'], colors_dark['secondary'], .5),
7065
}
66+
self._extras.update(
67+
{
68+
"DarkSelectionAlt": blendColors(tones_secondary[30], self._extras['SurfaceDark3'], .05*dbm),
69+
"LightSelectionAlt": blendColors(self._extras['SurfaceLight3'], tones_primary[30], .05*lbm),
70+
71+
"DarkSelectionHover": blendColors(tones_secondary[50], self._extras['SurfaceDark3'], .1*dbm),
72+
"LightSelectionHover": blendColors(self._extras['SurfaceLight3'], tones_primary[50], .1*lbm),
73+
}
74+
)
75+
7176
extras = self._extras
7277

7378
best_colors_count = len(colors_best)
@@ -112,33 +117,25 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
112117
tone = 50
113118
pywal_colors_light = (extras['SurfaceLight'],)
114119
pywal_colors_light_intense = (blendColors(
115-
tones_neutral[20], colors_light['secondary'], .8*lbm),)
120+
tones_neutral[50], colors_light['secondary'], .8*lbm),)
116121
pywal_colors_light_faint = (blendColors(
117-
tones_neutral[55], colors_light['secondary'], .8*lbm),)
118-
119-
# for x in range(7):
120-
# str_x = str(x)
121-
# if str_x in colors_best.keys()and color_luminance(colors_best[str_x])[1] > .15: #and contrast_ratio(pywal_colors_light[0],colors_best[str_x]) > .8
122-
# pywal_colors_light += (blend2contrast(colors_best[str_x], pywal_colors_light[0], tones_neutral[20], 4.5, .01, False),)
123-
# else:
124-
# pywal_colors_light += (blend2contrast(tones_primary[tone], pywal_colors_light[0], tones_neutral[20], 4.5, .01, False),)
125-
# pywal_colors_light += (blend2contrast(tones_tertiary[tone], pywal_colors_light[0], tones_neutral[20], 4.5, .01, False),)
126-
# if tone < 91:
127-
# tone += 8
122+
tones_neutral[75], colors_light['secondary'], .8*lbm),)
128123

124+
129125
for x in range(7):
130126
str_x = str(x)
131127
if (len(pywal_colors_light) <= 7):
132128
if str_x in colors_best.keys():
133-
c = scale_saturation(colors_best[str_x],1)
134-
pywal_colors_light += (blend2contrast(c, pywal_colors_light[0], tones_neutral[20], 3, .01, False),)
129+
c = scale_saturation(colors_best[str_x],1)
130+
c = lighteen_color(c,.2,tones_neutral[99])
131+
pywal_colors_light += (blend2contrast(c, pywal_colors_light[0], tones_neutral[10], 4.5, .01, False),)
135132
else:
136133
if (len(pywal_colors_light) <= 7):
137-
c = scale_saturation(tones_primary[tone],1)
138-
pywal_colors_light += (blend2contrast(c, pywal_colors_light[0], tones_neutral[20], 3, .01, False),)
134+
c = scale_saturation(tones_primary[tone],1)
135+
pywal_colors_light += (blend2contrast(c, pywal_colors_light[0], tones_neutral[10], 4.5, .01, False),)
139136
if (len(pywal_colors_light) <= 7):
140-
c = scale_saturation(tones_tertiary[tone],1)
141-
pywal_colors_light += (blend2contrast(c, pywal_colors_light[0], tones_neutral[20], 3, .01, False),)
137+
c = scale_saturation(tones_tertiary[tone],1)
138+
pywal_colors_light += (blend2contrast(c, pywal_colors_light[0], tones_neutral[10], 4.5, .01, False),)
142139
if tone < 91:
143140
tone += 8
144141
else:
@@ -149,11 +146,14 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
149146
sorted_colors = sort_colors_luminance(all,True)[-7:]
150147

151148
for n in range(len(sorted_colors)):
152-
pywal_colors_light_intense += (sorted_colors[n],)
153149
pywal_colors_light += (blendColors(
154-
tones_neutral[30], sorted_colors[n], .8*lbm),)
150+
tones_neutral[38], sorted_colors[n], .8*lbm),)
151+
152+
pywal_colors_light_intense += (blendColors(
153+
tones_neutral[33], sorted_colors[n], .8*lbm),)
154+
155155
pywal_colors_light_faint += (blendColors(
156-
tones_neutral[60], sorted_colors[n], .8*lbm),)
156+
tones_neutral[23], sorted_colors[n], .8*lbm),)
157157

158158

159159
# print("CONTRAST CHECK DARK")
@@ -176,7 +176,7 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
176176
IntensityEffect=2
177177
178178
[ColorEffects:Inactive]
179-
ChangeSelectionColor=false
179+
ChangeSelectionColor=true
180180
Color={colors_light['surfaceVariant']}
181181
ColorAmount=0.025
182182
ColorEffect=2
@@ -275,7 +275,7 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
275275
BackgroundNormal={extras['SurfaceLight']}
276276
DecorationFocus={colors_light['primary']}
277277
#-----------------------------------------------
278-
DecorationHover={colors_light['primary']}
278+
DecorationHover={extras['LightSelectionHover']}
279279
ForegroundActive={colors_light['inverseSurface']}
280280
ForegroundInactive={colors_light['outline']}
281281
ForegroundLink={extras['LinkOnSurfaceDark']}
@@ -327,7 +327,7 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
327327
IntensityEffect=2
328328
329329
[ColorEffects:Inactive]
330-
ChangeSelectionColor=false
330+
ChangeSelectionColor=true
331331
Color=Color={colors_dark['surfaceVariant']}
332332
ColorAmount=0.025
333333
ColorEffect=2
@@ -428,7 +428,7 @@ def __init__(self, colors, wallpaper_data, light_blend_multiplier=1, dark_blend_
428428
BackgroundNormal={extras['SurfaceDark']}
429429
DecorationFocus={colors_dark['primary']}
430430
#-----------------------------------------------
431-
DecorationHover={colors_dark['primary']}
431+
DecorationHover={colors_dark['inversePrimary']}
432432
ForegroundActive={colors_dark['inverseSurface']}
433433
ForegroundInactive={colors_dark['outline']}
434434
ForegroundLink={extras['LinkOnSurfaceDark']}

0 commit comments

Comments
 (0)