Text appeared black in dark theme after PR #507 (fix for light-theme text contrast).
MaterialTheme does not set LocalContentColor. Before #507, DarkBlueGrayTypography
baked explicit off-white values (Color(0xFFE0E0E0) etc.) into every TextStyle, which
happened to keep dark-theme text readable even without a Surface wrapper. After #507
removed those hardcoded colors (correctly, because they were invisible on the light
scheme’s white background), text fell back to Compose’s root default LocalContentColor
— which is Color.Black. Screens that sit inside a Surface were unaffected because
Surface seeds LocalContentColor from onSurface; screens that don’t use Surface
went black.
DarkBlueGrayTheme now wraps its content in a
CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onBackground)
block immediately inside the MaterialTheme call. This seeds the correct on-color from
the active scheme (near-black for light, off-white-gray for dark) before any content
composable reads LocalContentColor, without changing background painting or requiring
every screen to add a Surface.
LocalContentColor inside a custom theme composable that calls
MaterialTheme. If the theme does not use a Surface wrapper at its root, add a
CompositionLocalProvider(LocalContentColor provides colorScheme.onBackground) block.Typography, verify on BOTH light and dark
themes before merging — the two failure modes are opposite (too light on white vs
inherits black root default).KrillThemeTest: one guards that ChirpyDarkColorScheme
.onBackground is a light color (red channel > 0.5); the other asserts it is not
Color.Black.