I use dynamic theming in my jetpack compose app, yet all the colors are just too dark. Just look at my top app bar. How do I get access to lighter variations of colorScheme, for example my primary color?
If you look at the dynamicLightColorScheme()
function source code, you can see what's going on there. They are creating Dynamic tonal palette, which is internal, but eventually you can get to the code you can use in your app. The color is created like this:
val context = LocalContext.current
val color = Color(context.resources.getColor(colorId, context.theme)
Now you just need that colorId
. You can take that from the dynamicTonalPalette()
source code. For example, the default primary color for light dynamic theme is android.R.color.system_accent1_600
. If you want lighter color, you can try android.R.color.system_accent1_300
.