Fix unreadable light-on-amber elements in the dark theme

The dark color scheme painted the amber accent containers (primary buttons,
selected filter chips, the selected sidebar row, the account avatar) with
the default light on-colors, so their text was light-on-amber and barely
legible. Pair every amber container/accent with a dark on-color in both
schemes, and let the selected sidebar row's shortcut hint inherit that dark
color instead of the muted grey variant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQTVwy8RBj7spdEK3aEc3i
This commit is contained in:
Claude
2026-09-28 10:12:11 -03:00
committed by greenart7c3
parent f4617fa220
commit eebe3d69e4
2 changed files with 22 additions and 2 deletions
@@ -245,7 +245,13 @@ private fun SidebarItem(
Text(
shortcut,
style = MaterialTheme.typography.labelSmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
// On the selected (amber) row inherit the container's dark
// on-color; otherwise use the muted variant.
color = if (selected) {
MaterialTheme.colorScheme.onSecondaryContainer.copy(alpha = 0.7f)
} else {
MaterialTheme.colorScheme.onSurfaceVariant
},
maxLines = 1,
softWrap = false,
)
@@ -27,21 +27,35 @@ val primaryVariant = Color(0xFFC8541A)
val secondaryColor = Color(0xFFFFCA62)
val orange = Color(0xFFFF6B00)
// The accent (amber / orange) is light, so anything painted on top of it —
// primary buttons, selected chips, the selected sidebar row — must use dark
// text. The default dark scheme pairs these containers with light on-colors,
// which is what produced the unreadable light-on-amber elements.
private val onAccent = Color(0xFF201A0B)
private val DarkColorPalette = darkColorScheme(
primary = primaryColor,
onPrimary = Color.White,
onPrimary = onAccent,
secondary = primaryVariant,
onSecondary = Color.White,
tertiary = secondaryColor,
onTertiary = onAccent,
primaryContainer = secondaryColor,
onPrimaryContainer = onAccent,
secondaryContainer = secondaryColor,
onSecondaryContainer = onAccent,
)
private val LightColorPalette = lightColorScheme(
primary = primaryColor,
onPrimary = onAccent,
secondary = primaryVariant,
tertiary = secondaryColor,
onTertiary = onAccent,
primaryContainer = secondaryColor,
onPrimaryContainer = onAccent,
secondaryContainer = secondaryColor,
onSecondaryContainer = onAccent,
surface = Color(0xFFFFDE9E),
surfaceContainer = Color(0xFFFFDE9E),
)