-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button colors doesn't respect current theme #15
Comments
This library uses MD3. Mixing it with MD2 leads to issues with colors. |
Yes please. I've considered to use MD3 before, but sadly some components hasn't been supported yet. |
WorkaroundYou can add Material3 dependency and use it in your theme: private val LightColorPalette = lightColors(
primary = BrandBlue,
primaryVariant = BrandBlue,
secondary = BrandYellow,
onPrimary = Color.White,
onSecondary = Color.White,
error = Red,
onError = Color.White
)
@Composable
fun AppTheme(content: @Composable () -> Unit) {
MaterialTheme(
colors = LightColorPalette,
typography = Typography,
shapes = Shapes
) {
androidx.compose.material3.MaterialTheme(
colorScheme = androidx.compose.material3.MaterialTheme.colorScheme.copy(
primary = LightColorPalette.primary,
primaryContainer = LightColorPalette.primary,
secondary = LightColorPalette.primary,
secondaryContainer = LightColorPalette.primary,
tertiary = LightColorPalette.secondary,
tertiaryContainer = LightColorPalette.secondary,
onPrimary = LightColorPalette.onPrimary,
onSecondary = LightColorPalette.onPrimary,
onTertiary = LightColorPalette.onSecondary,
error = LightColorPalette.error,
onError = LightColorPalette.onError,
surface = LightColorPalette.surface,
background = LightColorPalette.background
),
androidx.compose.material3.MaterialTheme.shapes.copy(
small = Shapes.small,
medium = Shapes.medium,
large = Shapes.large
),
content = content
)
}
} Theming Guide. |
it's works, thanks |
what color is used for what? primary = LightColorPalette.primary, |
I tried to implement a simple confirmation dialog with
CoreDialog
, here's what I get:Despite that the primary color is blue, the button that showed is purple, and there are no parameters I can pass to customize it.
I use Material2. Do you have any solution?
The text was updated successfully, but these errors were encountered: