@@ -11,6 +11,7 @@ import androidx.compose.material3.Shapes
1111import androidx.compose.material3.Typography
1212import androidx.compose.runtime.Composable
1313import androidx.compose.runtime.SideEffect
14+ import androidx.compose.ui.graphics.Color
1415import androidx.compose.ui.graphics.toArgb
1516import androidx.compose.ui.platform.LocalView
1617import androidx.core.graphics.luminance
@@ -90,6 +91,7 @@ object CatppuccinTheme {
9091 * @param colorScheme A complete definition of the Material Color theme for this hierarchy.
9192 * @param typography A set of text styles to be used as this hierarchy's typography system.
9293 * @param shapes A set of corner shapes to be used as this hierarchy's shape system.
94+ * @param statusBarColor A color to paint status bar with, by default uses surface theme color.
9395 * @param isAppearanceLightStatusBars If true, changes the foreground color of the status bars
9496 * to light so that the items on the bar can be read clearly.
9597 * @param content Child composable UI to theme.
@@ -102,15 +104,15 @@ object CatppuccinTheme {
102104 colorScheme : ColorScheme = Catppuccin .Latte .colorScheme(),
103105 typography : Typography = Catppuccin .Latte .typography(),
104106 shapes : Shapes = MaterialTheme .shapes,
107+ statusBarColor : Color = colorScheme.surface,
105108 isAppearanceLightStatusBars : Boolean ,
106109 content : @Composable () -> Unit ,
107110 ) {
108111 val view = LocalView .current
109112 if (! view.isInEditMode) {
110113 SideEffect {
111114 val window = (view.context as Activity ).window
112- val statusBarColor = colorScheme.surface.toArgb()
113- window.statusBarColor = statusBarColor
115+ window.statusBarColor = statusBarColor.toArgb()
114116 WindowCompat
115117 .getInsetsController(window, view)
116118 .isAppearanceLightStatusBars = isAppearanceLightStatusBars
0 commit comments