How can I change the ripple color of an IconButton?
I tried doing it this way, but it doesn't change:
IconButton(
onClick = { onClick() },
modifier = Modifier.clickable(
onClick = { onClick() },
indication = rememberRipple(color = MyCustomTheme.colors.primary),
interactionSource = remember { MutableInteractionSource() },
)
)


I don't know if you found a way to make it work for the whole app but I found a way to do so. So I'm posting this incase someone else has a similar issue.
You can set the custom
RippleThemeobject as described by Gabriele Mariotti's answer then you can pass theCompositionLocalProvider()as content in MaterialTheme. The content from the app'sthemecan then be set as content forCompositionalLocalProvider().Take a look here:
Then for your app theme it should be:
This method should work for the whole app unless you explicitly set another
RippleThemedirectly to Composables below theAppThemehierarchy. And it doesn't conflict with other types ofComposableLocalProvidervalues you may set directly to your otherComposables.