CompositionLocalProvider(LocalContentColor provides Color.Blue) { // content color for all components in this scope is blue Text(text = "Lorem") CompositionLocalProvider(LocalContentColor provides Color.Red) { // content color for all components in this scope is blue Text(text = "ipsum") Text(text = "dolor") CompositionLocalProvider(LocalContentAlpha provides 0.2f) { // alpha of all components in this scope is 0.2f Text(text = "sit...") } } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter