Skip to content

Commit c970bf5

Browse files
authored
Merge pull request #535 from theovilardo/fix-light-mode-player-6341497516053891833
Fix Light Mode Player UI Contrast & Backgrounds
2 parents f89db89 + edab384 commit c970bf5

1 file changed

Lines changed: 37 additions & 23 deletions

File tree

app/src/main/java/com/theveloper/pixelplay/ui/theme/ColorRoles.kt

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,16 @@ fun generateColorSchemeFromSeed(seedColor: Color): ColorSchemePair {
8787

8888
// --- Tonal Palettes ---
8989
// Primary Tones
90+
val lightPrimary10 = lightSeed.tone(10)
91+
val lightPrimary40 = lightSeed.tone(40)
9092
val lightPrimary48 = lightSeed.tone(48)
9193
val lightPrimary56 = lightSeed.tone(56)
9294
val lightPrimary64 = lightSeed.tone(64)
9395
val lightPrimary76 = lightSeed.tone(76)
9496
val lightPrimary84 = lightSeed.tone(84)
97+
val lightPrimary90 = lightSeed.tone(90)
9598
val lightPrimary92 = lightSeed.tone(92)
99+
val lightPrimary95 = lightSeed.tone(95)
96100

97101
val darkPrimary18 = darkSeed.tone(18)
98102
val darkPrimary26 = darkSeed.tone(26)
@@ -105,12 +109,16 @@ fun generateColorSchemeFromSeed(seedColor: Color): ColorSchemePair {
105109
// Secondary Tones (Shift hue, adjust chroma)
106110
val secondarySeed = hctToColor((lightSeed.toHct().first + 38f) % 360f, 0.36f, lightSeed.toHct().third)
107111
.withMinChroma(0.32f, maxChroma = 0.54f)
112+
val lightSecondary10 = secondarySeed.tone(10)
113+
val lightSecondary40 = secondarySeed.tone(40)
108114
val lightSecondary46 = secondarySeed.tone(46)
109115
val lightSecondary54 = secondarySeed.tone(54)
110116
val lightSecondary64 = secondarySeed.tone(64)
111117
val lightSecondary76 = secondarySeed.tone(76)
112118
val lightSecondary86 = secondarySeed.tone(86)
119+
val lightSecondary90 = secondarySeed.tone(90)
113120
val lightSecondary94 = secondarySeed.tone(94)
121+
val lightSecondary95 = secondarySeed.tone(95)
114122

115123
val darkSecondary22 = secondarySeed.tone(22)
116124
val darkSecondary30 = secondarySeed.tone(30)
@@ -122,12 +130,15 @@ fun generateColorSchemeFromSeed(seedColor: Color): ColorSchemePair {
122130
// Tertiary Tones (Shift hue differently, adjust chroma)
123131
val tertiarySeed = hctToColor((lightSeed.toHct().first + 115f) % 360f, 0.38f, lightSeed.toHct().third)
124132
.withMinChroma(0.3f, maxChroma = 0.56f)
133+
val lightTertiary10 = tertiarySeed.tone(10)
134+
val lightTertiary40 = tertiarySeed.tone(40)
125135
val lightTertiary48 = tertiarySeed.tone(48)
126136
val lightTertiary58 = tertiarySeed.tone(58)
127137
val lightTertiary70 = tertiarySeed.tone(70)
128138
val lightTertiary82 = tertiarySeed.tone(82)
129139
val lightTertiary90 = tertiarySeed.tone(90)
130140
val lightTertiary96 = tertiarySeed.tone(96)
141+
val lightTertiary95 = tertiarySeed.tone(95)
131142

132143
val darkTertiary22 = tertiarySeed.tone(22)
133144
val darkTertiary32 = tertiarySeed.tone(32)
@@ -143,11 +154,14 @@ fun generateColorSchemeFromSeed(seedColor: Color): ColorSchemePair {
143154
val lightNeutral16 = lightNeutralSeed.tone(16)
144155
val lightNeutral22 = lightNeutralSeed.tone(22)
145156
val lightNeutral30 = lightNeutralSeed.tone(30)
157+
val lightNeutral50 = lightNeutralSeed.tone(50)
146158
val lightNeutral84 = lightNeutralSeed.tone(84)
147159
val lightNeutral88 = lightNeutralSeed.tone(88)
160+
val lightNeutral90 = lightNeutralSeed.tone(90)
148161
val lightNeutral92 = lightNeutralSeed.tone(92)
149162
val lightNeutral95 = lightNeutralSeed.tone(95)
150163
val lightNeutral98 = lightNeutralSeed.tone(98)
164+
val lightNeutral99 = lightNeutralSeed.tone(99)
151165

152166
val darkNeutralSeed = darkSeed.withChroma(0.08f)
153167
val darkNeutral6 = darkNeutralSeed.tone(6) // deeper dark surface
@@ -161,36 +175,36 @@ fun generateColorSchemeFromSeed(seedColor: Color): ColorSchemePair {
161175
val darkNeutral92 = darkNeutralSeed.tone(92)
162176

163177

164-
// Light Color Scheme
178+
// Light Color Scheme (Refined for better contrast and legibility)
165179
val lightScheme = lightColorScheme(
166-
primary = lightPrimary64,
167-
onPrimary = lightNeutral4,
168-
primaryContainer = lightPrimary92,
169-
onPrimaryContainer = lightPrimary56,
170-
secondary = lightSecondary64,
171-
onSecondary = lightNeutral4,
172-
secondaryContainer = lightSecondary94,
173-
onSecondaryContainer = lightSecondary54,
174-
tertiary = lightTertiary70,
175-
onTertiary = lightNeutral4,
176-
tertiaryContainer = lightTertiary96,
177-
onTertiaryContainer = lightTertiary58,
180+
primary = lightPrimary40, // Standard M3 Primary (Tone 40)
181+
onPrimary = lightPrimary95, // Tinted White (Tone 95)
182+
primaryContainer = lightPrimary90, // Pastel Container (Tone 90)
183+
onPrimaryContainer = lightPrimary10, // High Contrast Text (Tone 10)
184+
secondary = lightSecondary40,
185+
onSecondary = lightSecondary95,
186+
secondaryContainer = lightSecondary90,
187+
onSecondaryContainer = lightSecondary10,
188+
tertiary = lightTertiary40,
189+
onTertiary = lightTertiary95,
190+
tertiaryContainer = lightTertiary90,
191+
onTertiaryContainer = lightTertiary10,
178192
error = Color(0xFFBA1A1A), // M3 Defaults
179193
onError = Color.White,
180194
errorContainer = Color(0xFFFFDAD6),
181195
onErrorContainer = Color(0xFF410002),
182-
background = lightNeutral98,
183-
onBackground = lightNeutral22,
184-
surface = lightNeutral95,
185-
onSurface = lightNeutral22,
186-
surfaceVariant = lightNeutral84,
187-
onSurfaceVariant = lightNeutral30,
188-
outline = lightNeutral30,
196+
background = lightNeutral99, // Clean light background
197+
onBackground = lightNeutral10, // Dark text
198+
surface = lightNeutral99, // Clean light surface
199+
onSurface = lightNeutral10, // Dark text
200+
surfaceVariant = lightNeutral90, // Slightly darker surface for differentiation
201+
onSurfaceVariant = lightNeutral30, // Contrast for variant
202+
outline = lightNeutral50,
189203
inverseOnSurface = lightNeutral95,
190204
inverseSurface = lightNeutral22,
191-
inversePrimary = lightPrimary76,
192-
surfaceTint = lightPrimary64,
193-
outlineVariant = lightNeutral88,
205+
inversePrimary = lightPrimary84, // Lighter for inverse
206+
surfaceTint = lightPrimary40,
207+
outlineVariant = lightNeutral84,
194208
scrim = Color.Black
195209
)
196210

0 commit comments

Comments
 (0)