diff --git a/composeApp/src/commonMain/kotlin/MainPage.kt b/composeApp/src/commonMain/kotlin/MainPage.kt index 255caee2..eb6d0240 100644 --- a/composeApp/src/commonMain/kotlin/MainPage.kt +++ b/composeApp/src/commonMain/kotlin/MainPage.kt @@ -55,7 +55,7 @@ fun MainPage( modifier = Modifier.padding(horizontal = 12.dp), imageVector = MiuixIcons.Search, colorFilter = BlendModeColorFilter( - MiuixTheme.colorScheme.onPrimary, + MiuixTheme.colorScheme.onSurfaceContainer, BlendMode.SrcIn ), contentDescription = "Search" diff --git a/composeApp/src/commonMain/kotlin/component/OtherComponent.kt b/composeApp/src/commonMain/kotlin/component/OtherComponent.kt index fd085259..b1a1dfce 100644 --- a/composeApp/src/commonMain/kotlin/component/OtherComponent.kt +++ b/composeApp/src/commonMain/kotlin/component/OtherComponent.kt @@ -16,7 +16,6 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.ImeAction @@ -34,7 +33,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme @Composable fun OtherComponent(padding: PaddingValues) { - var buttonText by remember { mutableStateOf("Button") } + var buttonText by remember { mutableStateOf("Cancel") } var submitButtonText by remember { mutableStateOf("Submit") } var clickCount by remember { mutableStateOf(0) } var submitClickCount by remember { mutableStateOf(0) } @@ -79,7 +78,7 @@ fun OtherComponent(padding: PaddingValues) { Button( modifier = Modifier.weight(1f), text = "Disabled", - submit = true, + submit = false, enabled = false, onClick = {} ) @@ -87,7 +86,7 @@ fun OtherComponent(padding: PaddingValues) { Button( modifier = Modifier.weight(1f), text = "Disabled", - submit = false, + submit = true, enabled = false, onClick = {} ) @@ -104,7 +103,7 @@ fun OtherComponent(padding: PaddingValues) { TextField( value = text2, onValueChange = { text2 = it }, - backgroundColor = MiuixTheme.colorScheme.primaryContainer, + backgroundColor = MiuixTheme.colorScheme.secondaryContainer, label = "Text Field", modifier = Modifier.padding(horizontal = 12.dp), keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }), @@ -128,9 +127,21 @@ fun OtherComponent(padding: PaddingValues) { modifier = Modifier .fillMaxWidth() .padding(horizontal = 12.dp, vertical = 12.dp), + color = MiuixTheme.colorScheme.primaryVariant, insideMargin = DpSize(16.dp, 16.dp) ) { - CardView() + Text( + color = MiuixTheme.colorScheme.onPrimary, + text = "Card 123456789", + fontSize = 19.sp, + fontWeight = FontWeight.Bold + ) + Text( + color = MiuixTheme.colorScheme.onPrimaryVariant, + text = "一二三四五六七八九", + fontSize = 15.sp, + fontWeight = FontWeight.Normal + ) } Card( @@ -138,37 +149,31 @@ fun OtherComponent(padding: PaddingValues) { .fillMaxWidth() .padding(horizontal = 12.dp) .padding(bottom = 12.dp + padding.calculateBottomPadding()), - color = MiuixTheme.colorScheme.primary, insideMargin = DpSize(16.dp, 16.dp) ) { - CardView(color = Color.White) + val color = MiuixTheme.colorScheme.onSurface + Text( + color = color, + text = "Card", + style = MiuixTheme.textStyles.paragraph, + fontWeight = FontWeight.SemiBold, + fontSize = 16.sp + ) + Spacer(Modifier.height(6.dp)) + Text( + color = color, + text = "123456789", + style = MiuixTheme.textStyles.paragraph + ) + Text( + color = color, + text = "一二三四五六七八九", + style = MiuixTheme.textStyles.paragraph + ) + Text( + color = color, + text = "!@#$%^&*()_+-=", + style = MiuixTheme.textStyles.paragraph + ) } - -} - -@Composable -fun CardView(color: Color = MiuixTheme.colorScheme.onBackground) { - Text( - color = color, - text = "Card", - style = MiuixTheme.textStyles.paragraph, - fontWeight = FontWeight.SemiBold, - fontSize = 16.sp - ) - Spacer(Modifier.height(6.dp)) - Text( - color = color, - text = "123456789", - style = MiuixTheme.textStyles.paragraph - ) - Text( - color = color, - text = "一二三四五六七八九", - style = MiuixTheme.textStyles.paragraph - ) - Text( - color = color, - text = "!@#$%^&*()_+-=", - style = MiuixTheme.textStyles.paragraph - ) } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/component/TextComponent.kt b/composeApp/src/commonMain/kotlin/component/TextComponent.kt index 31801978..d212c022 100644 --- a/composeApp/src/commonMain/kotlin/component/TextComponent.kt +++ b/composeApp/src/commonMain/kotlin/component/TextComponent.kt @@ -185,7 +185,7 @@ fun TextComponent() { Text( modifier = Modifier.padding(end = 6.dp), text = miuixSuperRightCheckbox, - color = MiuixTheme.colorScheme.subTextBase + color = MiuixTheme.colorScheme.onSurfaceVariantActions ) }, onCheckedChange = { @@ -225,7 +225,7 @@ fun TextComponent() { Text( modifier = Modifier.padding(end = 6.dp), text = miuixSuperSwitch, - color = MiuixTheme.colorScheme.subTextBase + color = MiuixTheme.colorScheme.onSurfaceVariantActions ) }, onCheckedChange = { @@ -324,7 +324,6 @@ fun dialog2(showDialog: MutableState) { TextField( modifier = Modifier.padding(bottom = 16.dp), value = value.value, - backgroundColor = MiuixTheme.colorScheme.secondary, maxLines = 1, onValueChange = { value.value = it } ) diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Button.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Button.kt index ef2576f0..4f8f851b 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Button.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Button.kt @@ -82,7 +82,7 @@ private fun getButtonColor(enabled: Boolean, submit: Boolean): Color { return if (enabled) { if (submit) MiuixTheme.colorScheme.primary else MiuixTheme.colorScheme.secondary } else { - if (submit) MiuixTheme.colorScheme.disabledPrimary else MiuixTheme.colorScheme.disabledSecondary + if (submit) MiuixTheme.colorScheme.disabledPrimaryButton else MiuixTheme.colorScheme.disabledSecondaryVariant } } @@ -91,6 +91,6 @@ private fun getTextColor(enabled: Boolean, submit: Boolean): Color { return if (enabled) { if (submit) Color.White else MiuixTheme.colorScheme.onBackground } else { - if (submit) MiuixTheme.colorScheme.onDisabledPrimary else MiuixTheme.colorScheme.onDisabledSecondary + if (submit) MiuixTheme.colorScheme.disabledOnPrimaryButton else MiuixTheme.colorScheme.disabledOnSecondaryVariant } } \ No newline at end of file diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Card.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Card.kt index 3b35e80c..274755ba 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Card.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Card.kt @@ -30,7 +30,7 @@ fun Card( modifier: Modifier = Modifier, insideMargin: DpSize = DpSize(0.dp, 0.dp), cornerRadius: Dp = 18.dp, - color: Color = MiuixTheme.colorScheme.primaryContainer, + color: Color = MiuixTheme.colorScheme.surface, content: @Composable ColumnScope.() -> Unit ) { val shape = remember { SquircleShape(cornerRadius) } diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Checkbox.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Checkbox.kt index 42b49fe6..a889606c 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Checkbox.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Checkbox.kt @@ -23,7 +23,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.geometry.Offset -import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Matrix import androidx.compose.ui.graphics.Path import androidx.compose.ui.graphics.PathMeasure @@ -59,9 +58,16 @@ fun Checkbox( val backgroundColor by animateColorAsState(if (isChecked) MiuixTheme.colorScheme.primary else MiuixTheme.colorScheme.secondary) val disabledBackgroundColor by rememberUpdatedState(if (isChecked) MiuixTheme.colorScheme.disabledPrimary else MiuixTheme.colorScheme.disabledSecondary) val checkboxSize by animateDpAsState(if (isPressed) 20.dp else 22.dp) - val checkmarkColor by animateColorAsState(if (checked) Color.White else backgroundColor) - val rotationAngle by animateFloatAsState(if (checked) 0f else 25f, animationSpec = tween(durationMillis = 200)) - val pathProgress by animateFloatAsState(if (checked) 1f else 0f, animationSpec = tween(durationMillis = 400)) + val checkmarkColor by animateColorAsState(if (checked) MiuixTheme.colorScheme.onPrimary else backgroundColor) + val disabledCheckmarkColor by animateColorAsState(if (checked) MiuixTheme.colorScheme.disabledOnPrimary else disabledBackgroundColor) + val rotationAngle by animateFloatAsState( + if (checked) 0f else 25f, + animationSpec = tween(durationMillis = 200) + ) + val pathProgress by animateFloatAsState( + if (checked) 1f else 0f, + animationSpec = tween(durationMillis = 400) + ) val toggleableModifier = remember(onCheckedChange, isChecked, enabled) { if (onCheckedChange != null) { Modifier.toggleable( @@ -131,7 +137,7 @@ fun Checkbox( val length = pathMeasure.length val animatedPath = Path() pathMeasure.getSegment(length * (1 - pathProgress), length, animatedPath, true) - drawPath(animatedPath, checkmarkColor) + drawPath(animatedPath, if (enabled) checkmarkColor else disabledCheckmarkColor) } } } diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Component.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Component.kt index 05d58cf5..1a3c4010 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Component.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Component.kt @@ -40,8 +40,9 @@ fun BasicComponent( modifier: Modifier = Modifier, insideMargin: DpSize? = null, title: String? = null, - titleColor: Color = MiuixTheme.colorScheme.onBackground, + titleColor: Color = MiuixTheme.colorScheme.onSurface, summary: String? = null, + summaryColor: Color = MiuixTheme.colorScheme.onSurfaceVariantSummary, leftAction: @Composable (() -> Unit?)? = null, rightActions: @Composable RowScope.() -> Unit = {}, onClick: (() -> Unit)? = null, @@ -93,7 +94,7 @@ fun BasicComponent( Text( text = it, fontSize = MiuixTheme.textStyles.title.fontSize, - color = MiuixTheme.colorScheme.subTextBase + color = summaryColor ) } } diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/NavigationBar.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/NavigationBar.kt index ada55580..422cdb23 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/NavigationBar.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/NavigationBar.kt @@ -51,7 +51,7 @@ fun NavigationBar( items: List, selected: Int, modifier: Modifier = Modifier, - color: Color = MiuixTheme.colorScheme.background, + color: Color = MiuixTheme.colorScheme.surfaceContainer, onClick: (Int) -> Unit, defaultWindowInsetsPadding: Boolean = true ) { @@ -77,7 +77,7 @@ fun NavigationBar( ) { HorizontalDivider( thickness = 0.25.dp, - color = MiuixTheme.colorScheme.subTextBase + color = MiuixTheme.colorScheme.dividerLine ) Row( modifier = Modifier @@ -91,13 +91,13 @@ fun NavigationBar( val tint by animateColorAsState( targetValue = when { isPressed -> if (isSelected) { - MiuixTheme.colorScheme.onBackground.copy(alpha = 0.7f) + MiuixTheme.colorScheme.onSurfaceContainer.copy(alpha = 0.6f) } else { - MiuixTheme.colorScheme.subTextBase.copy(alpha = 0.7f) + MiuixTheme.colorScheme.onSurfaceContainerVariant.copy(alpha = 0.6f) } - isSelected -> MiuixTheme.colorScheme.onBackground - else -> MiuixTheme.colorScheme.subTextBase + isSelected -> MiuixTheme.colorScheme.onSurfaceContainer + else -> MiuixTheme.colorScheme.onSurfaceContainerVariant } ) Column( diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SearchBar.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SearchBar.kt index add1b91e..c38ad95f 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SearchBar.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SearchBar.kt @@ -163,7 +163,7 @@ fun InputField( Box( modifier = Modifier .background( - color = MiuixTheme.colorScheme.searchBarBg, + color = MiuixTheme.colorScheme.surfaceContainerHigh, shape = SquircleShape(50.dp) ) ) { @@ -182,7 +182,7 @@ fun InputField( ) { Text( text = if (!(query.isNotEmpty() || expanded)) label else "", - color = MiuixTheme.colorScheme.searchBarSub + color = MiuixTheme.colorScheme.onSurfaceContainerHigh ) innerTextField() diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Slider.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Slider.kt index 601a91c9..bb84f74b 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Slider.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Slider.kt @@ -67,8 +67,8 @@ fun Slider( (round(newValue * factor) / factor).coerceIn(minValue, maxValue) } } - val color = rememberUpdatedState(if (enabled) MiuixTheme.colorScheme.primary else MiuixTheme.colorScheme.disabledPrimary) - val backgroundColor = rememberUpdatedState(if (enabled) MiuixTheme.colorScheme.secondary else MiuixTheme.colorScheme.disabledSecondary) + val color = rememberUpdatedState(if (enabled) MiuixTheme.colorScheme.primary else MiuixTheme.colorScheme.disabledPrimarySlider) + val backgroundColor = rememberUpdatedState(MiuixTheme.colorScheme.tertiaryContainerVariant) Box( modifier = if (enabled) { diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SmallTitle.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SmallTitle.kt index 4df9e82e..68c8a0c7 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SmallTitle.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/SmallTitle.kt @@ -31,6 +31,6 @@ fun SmallTitle( text = text, fontSize = 14.sp, fontWeight = FontWeight.Medium, - color = MiuixTheme.colorScheme.smallTitle + color = MiuixTheme.colorScheme.onBackgroundVariant ) } \ No newline at end of file diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Switch.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Switch.kt index 91cd6e9e..e4e7a52f 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Switch.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Switch.kt @@ -23,7 +23,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color import androidx.compose.ui.hapticfeedback.HapticFeedbackType import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalHapticFeedback @@ -85,9 +84,9 @@ fun Switch( val disabledBackgroundColor by rememberUpdatedState( if (isChecked) MiuixTheme.colorScheme.disabledPrimary else MiuixTheme.colorScheme.disabledSecondary ) - val thumbColor = Color.White + val thumbColor by rememberUpdatedState(if (isChecked) MiuixTheme.colorScheme.onPrimary else MiuixTheme.colorScheme.onSecondary) val disabledThumbColor by rememberUpdatedState( - if (isChecked) MiuixTheme.colorScheme.onDisabledPrimary else MiuixTheme.colorScheme.onDisabledSecondary + if (isChecked) MiuixTheme.colorScheme.disabledOnPrimary else MiuixTheme.colorScheme.disabledOnSecondary ) val toggleableModifier = remember(onCheckedChange, isChecked, enabled) { if (onCheckedChange != null) { @@ -150,7 +149,11 @@ fun Switch( onDrag = { change, dragAmount -> if (!enabled) return@detectDragGestures val newOffset = dragOffset + dragAmount.x / 2 - dragOffset = if (isChecked) newOffset.coerceIn(-24f, 0f) else newOffset.coerceIn(0f, 24f) + dragOffset = + if (isChecked) newOffset.coerceIn(-24f, 0f) else newOffset.coerceIn( + 0f, + 24f + ) if (isChecked) { if (dragOffset in -23f..-1f) { hasVibrated = false @@ -176,7 +179,10 @@ fun Switch( .padding(start = thumbOffset) .align(Alignment.CenterStart) .size(thumbSize) - .background(if (enabled) thumbColor else disabledThumbColor, shape = SquircleShape(100.dp)) + .background( + if (enabled) thumbColor else disabledThumbColor, + shape = SquircleShape(100.dp) + ) ) } } \ No newline at end of file diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Text.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Text.kt index 285917be..07b9628b 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Text.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Text.kt @@ -79,7 +79,7 @@ fun Text( onTextLayout: ((TextLayoutResult) -> Unit)? = null, style: TextStyle = MiuixTheme.textStyles.main ) { - val textColor by rememberUpdatedState(if (color.isSpecified) color else if (style.color.isSpecified) style.color else MiuixTheme.colorScheme.primary) + val textColor by rememberUpdatedState(if (color.isSpecified) color else if (style.color.isSpecified) style.color else MiuixTheme.colorScheme.onBackground) BasicText( text, @@ -162,7 +162,7 @@ fun Text( onTextLayout: (TextLayoutResult) -> Unit = {}, style: TextStyle = MiuixTheme.textStyles.main ) { - val textColor by rememberUpdatedState(if (color.isSpecified) color else if (style.color.isSpecified) style.color else MiuixTheme.colorScheme.primary) + val textColor by rememberUpdatedState(if (color.isSpecified) color else if (style.color.isSpecified) style.color else MiuixTheme.colorScheme.onBackground) BasicText( text = text, diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/TextField.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/TextField.kt index 8c127b8b..4e0c12d7 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/TextField.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/TextField.kt @@ -66,10 +66,10 @@ fun TextField( onValueChange: (TextFieldValue) -> Unit, modifier: Modifier = Modifier, insideMargin: DpSize = DpSize(16.dp, 16.dp), - backgroundColor: Color = MiuixTheme.colorScheme.textFieldBg, + backgroundColor: Color = MiuixTheme.colorScheme.secondaryContainer, cornerRadius: Dp = 18.dp, label: String = "", - labelColor: Color = MiuixTheme.colorScheme.textFieldSub, + labelColor: Color = MiuixTheme.colorScheme.onSecondaryContainer, enabled: Boolean = true, readOnly: Boolean = false, textStyle: TextStyle = MiuixTheme.textStyles.main, @@ -196,10 +196,10 @@ fun TextField( onValueChange: (String) -> Unit, modifier: Modifier = Modifier, insideMargin: DpSize = DpSize(16.dp, 16.dp), - backgroundColor: Color = MiuixTheme.colorScheme.textFieldBg, + backgroundColor: Color = MiuixTheme.colorScheme.secondaryContainer, cornerRadius: Dp = 18.dp, label: String = "", - labelColor: Color = MiuixTheme.colorScheme.textFieldSub, + labelColor: Color = MiuixTheme.colorScheme.onSecondaryContainer, enabled: Boolean = true, readOnly: Boolean = false, textStyle: TextStyle = MiuixTheme.textStyles.main, diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperArrow.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperArrow.kt index c019d297..73a32f5e 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperArrow.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperArrow.kt @@ -36,7 +36,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme fun SuperArrow( modifier: Modifier = Modifier, title: String, - titleColor: Color = MiuixTheme.colorScheme.onBackground, + titleColor: Color = MiuixTheme.colorScheme.onSurface, summary: String? = null, leftAction: @Composable (() -> Unit)? = null, rightText: String? = null, @@ -67,7 +67,7 @@ private fun createRightActions(rightText: String?) { Text( text = rightText, fontSize = 15.sp, - color = MiuixTheme.colorScheme.subTextBase, + color = MiuixTheme.colorScheme.onSurfaceVariantActions, textAlign = TextAlign.End, ) } @@ -77,6 +77,6 @@ private fun createRightActions(rightText: String?) { .padding(start = 6.dp), imageVector = MiuixIcons.ArrowRight, contentDescription = null, - colorFilter = BlendModeColorFilter(MiuixTheme.colorScheme.subTextBase, BlendMode.SrcIn), + colorFilter = BlendModeColorFilter(MiuixTheme.colorScheme.onSurfaceVariantActions, BlendMode.SrcIn), ) } \ No newline at end of file diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperCheckbox.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperCheckbox.kt index ec593c64..2d03d9f5 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperCheckbox.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperCheckbox.kt @@ -31,7 +31,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme @Composable fun SuperCheckbox( title: String, - titleColor: Color = MiuixTheme.colorScheme.onBackground, + titleColor: Color = MiuixTheme.colorScheme.onSurface, summary: String? = null, rightActions: @Composable RowScope.() -> Unit = {}, checked: Boolean, diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDialog.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDialog.kt index cf9ed599..718b5566 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDialog.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDialog.kt @@ -47,8 +47,9 @@ import top.yukonga.miuix.kmp.utils.squircleshape.SquircleShape @Composable fun SuperDialog( title: String? = null, - titleColor: Color = MiuixTheme.colorScheme.onBackground, + titleColor: Color = MiuixTheme.colorScheme.onSurface, summary: String? = null, + summaryColor: Color = MiuixTheme.colorScheme.onSurfaceVariantDialog, show: MutableState, onDismissRequest: () -> Unit, insideMargin: DpSize? = null, @@ -94,7 +95,7 @@ fun SuperDialog( clip = false ) .background( - color = MiuixTheme.colorScheme.dropdownBackground, + color = MiuixTheme.colorScheme.surfaceVariant, shape = SquircleShape(bottomCornerRadius) ) .padding(24.dp), @@ -113,7 +114,8 @@ fun SuperDialog( Text( modifier = Modifier.fillMaxWidth().padding(bottom = 20.dp), text = it, - textAlign = TextAlign.Center + textAlign = TextAlign.Center, + color = summaryColor ) } content() diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt index 9e9dc7b3..71c42226 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperDropdown.kt @@ -86,7 +86,7 @@ expect fun modifierPlatform(modifier: Modifier, isHovered: MutableState @Composable fun SuperDropdown( title: String, - titleColor: Color = MiuixTheme.colorScheme.onBackground, + titleColor: Color = MiuixTheme.colorScheme.onSurface, summary: String? = null, modifier: Modifier = Modifier, items: List, @@ -166,7 +166,7 @@ fun SuperDropdown( modifier = Modifier.padding(end = 6.dp), text = items[selectedIndex], fontSize = 15.sp, - color = MiuixTheme.colorScheme.subTextBase, + color = MiuixTheme.colorScheme.onSurfaceVariantActions, textAlign = TextAlign.End, ) Image( @@ -175,7 +175,7 @@ fun SuperDropdown( .align(Alignment.CenterVertically), imageVector = MiuixIcons.ArrowUpDown, colorFilter = BlendModeColorFilter( - MiuixTheme.colorScheme.subTextBase, + MiuixTheme.colorScheme.onSurfaceVariantActions, BlendMode.SrcIn ), contentDescription = null @@ -227,7 +227,7 @@ fun SuperDropdown( clip = false ) .clip(SquircleShape(18.dp)) - .background(MiuixTheme.colorScheme.dropdownBackground) + .background(MiuixTheme.colorScheme.surface) ) { item { items.forEachIndexed { index, option -> @@ -272,19 +272,19 @@ fun DropdownImpl( val additionalTopPadding = if (index == 0) 24.dp else 14.dp val additionalBottomPadding = if (index == options.size - 1) 24.dp else 14.dp val textColor = if (isSelected) { - MiuixTheme.colorScheme.primary + MiuixTheme.colorScheme.onTertiaryContainer } else { - MiuixTheme.colorScheme.onBackground + MiuixTheme.colorScheme.onSurface } val selectColor = if (isSelected) { - MiuixTheme.colorScheme.primary + MiuixTheme.colorScheme.onTertiaryContainer } else { Color.Transparent } val backgroundColor = if (isSelected) { - MiuixTheme.colorScheme.dropdownSelect + MiuixTheme.colorScheme.tertiaryContainer } else { - MiuixTheme.colorScheme.dropdownBackground + MiuixTheme.colorScheme.surface } Row( verticalAlignment = Alignment.CenterVertically, @@ -308,7 +308,7 @@ fun DropdownImpl( color = textColor, ) Image( - modifier = Modifier.padding(start = 50.dp).size(16.dp), + modifier = Modifier.padding(start = 50.dp).size(20.dp), imageVector = MiuixIcons.Check, colorFilter = BlendModeColorFilter(selectColor, BlendMode.SrcIn), contentDescription = null, diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperSwitch.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperSwitch.kt index bde22f18..98683857 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperSwitch.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/extra/SuperSwitch.kt @@ -32,7 +32,7 @@ import top.yukonga.miuix.kmp.theme.MiuixTheme @Composable fun SuperSwitch( title: String, - titleColor: Color = MiuixTheme.colorScheme.onBackground, + titleColor: Color = MiuixTheme.colorScheme.onSurface, summary: String? = null, leftAction: @Composable (() -> Unit)? = null, rightActions: @Composable RowScope.() -> Unit = {}, diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt index 980d7bad..72ac3127 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixColor.kt @@ -9,102 +9,239 @@ import androidx.compose.ui.graphics.Color /** * The default color scheme for the Miuix components. * - * @param primary The primary color. - * @param onPrimary The color of the text on primary color. - * @param primaryContainer The color of the primary container. - * @param background The background color. - * @param onBackground The color of the text on background. - * @param subTextBase The base color of the sub text. + * @param primary The primary color.Cases:Switch, Button, Slider + * @param onPrimary The color of the text on primary color.Cases:Switch, Button, Slider + * @param primaryVariant The variant color of the primary color.Cases:Card + * @param onPrimaryVariant The color of the text on primary variant color. + * @param disabledPrimary The disabled primary color of the switch. + * @param disabledOnPrimary The color of the switch on disabled primary color. + * @param disabledPrimaryButton The disabled primary color of the button. + * @param disabledOnPrimaryButton The color of the button on disabled primary color. + * @param disabledPrimarySlider The disabled primary color of the slider. + * @param primaryContainer The container color of the primary color. + * @param onPrimaryContainer The color of the text on primary container color. * @param secondary The secondary color. - * @param dropdownBackground The background color of the dropdown. - * @param dropdownSelect The color of the selected item in the dropdown. - * @param textFieldBg The background color of the text field. - * @param textFieldSub The color of the sub text field. - * @param disabledSecondary The background color of the disabled button. - * @param disabledPrimary The background color of the disabled submit button. - * @param onDisabledSecondary The text color of the disabled button. - * @param onDisabledPrimary The text color of the disabled submit button. - * @param smallTitle The color of the small title. + * @param onSecondary The color of the text on secondary color. + * @param secondaryVariant The variant color of the secondary color. + * @param onSecondaryVariant The color of the text on secondary variant color. + * @param disabledSecondary The disabled secondary color. + * @param disabledOnSecondary The color of the text on disabled secondary color. + * @param disabledSecondaryVariant The disabled secondary color. + * @param disabledOnSecondaryVariant The color of the text on disabled secondary variant color. + * @param secondaryContainer The container color of the secondary color. + * @param onSecondaryContainer The color of the text on secondary container color. + * @param secondaryContainerVariant The variant color of the secondary container color. + * @param onSecondaryContainerVariant The color of the text on secondary container variant color. + * @param tertiaryContainer The container color of the tertiary color. + * @param onTertiaryContainer The color of the text on tertiary container color. + * @param tertiaryContainerVariant The variant color of the tertiary container color. + * @param background The background color. + * @param onBackground The color of the text on background color. + * @param onBackgroundVariant The color of the text on background variant color. + * @param surface The surface color. + * @param onSurface The color of the text on surface color. + * @param surfaceVariant The variant color of the surface color. + * @param onSurfaceVariantDialog The color of the dialog summary on surface variant color. + * @param onSurfaceVariantSummary The color of the summary on surface variant color. + * @param onSurfaceVariantActions The color of the actions on surface variant color. + * @param disabledOnSurface The color of the text on disabled surface color. + * @param outline The outline color. + * @param dividerLine The divider line color. + * @param surfaceContainer The container color of the surface color. + * @param onSurfaceContainer The color of the text on surface container color. + * @param onSurfaceContainerVariant The color of the text on surface container variant color. + * @param surfaceContainerHigh The container color of the surface color. + * @param onSurfaceContainerHigh The color of the text on surface container high color. + * @param surfaceContainerHighest The container color of the surface color. + * @param onSurfaceContainerHighest The color of the text on surface container highest color. */ @Stable class MiuixColor( primary: Color, onPrimary: Color, + primaryVariant: Color, + onPrimaryVariant: Color, + disabledPrimary: Color, + disabledOnPrimary: Color, + disabledPrimaryButton: Color, + disabledOnPrimaryButton: Color, + disabledPrimarySlider: Color, primaryContainer: Color, - background: Color, - onBackground: Color, - subTextBase: Color, + onPrimaryContainer: Color, secondary: Color, - dropdownBackground: Color, - dropdownSelect: Color, - searchBarBg: Color, - searchBarSub: Color, - textFieldBg: Color, - textFieldSub: Color, - disabledPrimary: Color, + onSecondary: Color, + secondaryVariant: Color, + onSecondaryVariant: Color, disabledSecondary: Color, - onDisabledPrimary: Color, - onDisabledSecondary: Color, - smallTitle: Color + disabledOnSecondary: Color, + disabledSecondaryVariant: Color, + disabledOnSecondaryVariant: Color, + secondaryContainer: Color, + onSecondaryContainer: Color, + secondaryContainerVariant: Color, + onSecondaryContainerVariant: Color, + tertiaryContainer: Color, + onTertiaryContainer: Color, + tertiaryContainerVariant: Color, + background: Color, + onBackground: Color, + onBackgroundVariant: Color, + surface: Color, + onSurface: Color, + surfaceVariant: Color, + onSurfaceVariantDialog: Color, + onSurfaceVariantSummary: Color, + onSurfaceVariantActions: Color, + disabledOnSurface: Color, + outline: Color, + dividerLine: Color, + surfaceContainer: Color, + onSurfaceContainer: Color, + onSurfaceContainerVariant: Color, + surfaceContainerHigh: Color, + onSurfaceContainerHigh: Color, + surfaceContainerHighest: Color, + onSurfaceContainerHighest: Color, ) { val primary by mutableStateOf(primary, structuralEqualityPolicy()) val onPrimary by mutableStateOf(onPrimary, structuralEqualityPolicy()) + val primaryVariant by mutableStateOf(primaryVariant, structuralEqualityPolicy()) + val onPrimaryVariant by mutableStateOf(onPrimaryVariant, structuralEqualityPolicy()) + val disabledPrimary by mutableStateOf(disabledPrimary, structuralEqualityPolicy()) + val disabledOnPrimary by mutableStateOf(disabledOnPrimary, structuralEqualityPolicy()) + val disabledPrimaryButton by mutableStateOf(disabledPrimaryButton, structuralEqualityPolicy()) + val disabledOnPrimaryButton by mutableStateOf(disabledOnPrimaryButton, structuralEqualityPolicy()) + val disabledPrimarySlider by mutableStateOf(disabledPrimarySlider, structuralEqualityPolicy()) val primaryContainer by mutableStateOf(primaryContainer, structuralEqualityPolicy()) - val background by mutableStateOf(background, structuralEqualityPolicy()) - val onBackground by mutableStateOf(onBackground, structuralEqualityPolicy()) - val subTextBase by mutableStateOf(subTextBase, structuralEqualityPolicy()) + val onPrimaryContainer by mutableStateOf(onPrimaryContainer, structuralEqualityPolicy()) val secondary by mutableStateOf(secondary, structuralEqualityPolicy()) - val dropdownBackground by mutableStateOf(dropdownBackground, structuralEqualityPolicy()) - val dropdownSelect by mutableStateOf(dropdownSelect, structuralEqualityPolicy()) - val searchBarBg by mutableStateOf(searchBarBg, structuralEqualityPolicy()) - val searchBarSub by mutableStateOf(searchBarSub, structuralEqualityPolicy()) - val textFieldBg by mutableStateOf(textFieldBg, structuralEqualityPolicy()) - val textFieldSub by mutableStateOf(textFieldSub, structuralEqualityPolicy()) - val disabledPrimary by mutableStateOf(disabledPrimary, structuralEqualityPolicy()) + val onSecondary by mutableStateOf(onSecondary, structuralEqualityPolicy()) + val secondaryVariant by mutableStateOf(secondaryVariant, structuralEqualityPolicy()) + val onSecondaryVariant by mutableStateOf(onSecondaryVariant, structuralEqualityPolicy()) val disabledSecondary by mutableStateOf(disabledSecondary, structuralEqualityPolicy()) - val onDisabledPrimary by mutableStateOf(onDisabledPrimary, structuralEqualityPolicy()) - val onDisabledSecondary by mutableStateOf(onDisabledSecondary, structuralEqualityPolicy()) - val smallTitle by mutableStateOf(smallTitle, structuralEqualityPolicy()) + val disabledOnSecondary by mutableStateOf(disabledOnSecondary, structuralEqualityPolicy()) + val disabledSecondaryVariant by mutableStateOf(disabledSecondaryVariant, structuralEqualityPolicy()) + val disabledOnSecondaryVariant by mutableStateOf(disabledOnSecondaryVariant, structuralEqualityPolicy()) + val secondaryContainer by mutableStateOf(secondaryContainer, structuralEqualityPolicy()) + val onSecondaryContainer by mutableStateOf(onSecondaryContainer, structuralEqualityPolicy()) + val secondaryContainerVariant by mutableStateOf(secondaryContainerVariant, structuralEqualityPolicy()) + val onSecondaryContainerVariant by mutableStateOf(onSecondaryContainerVariant, structuralEqualityPolicy()) + val tertiaryContainer by mutableStateOf(tertiaryContainer, structuralEqualityPolicy()) + val onTertiaryContainer by mutableStateOf(onTertiaryContainer, structuralEqualityPolicy()) + val tertiaryContainerVariant by mutableStateOf(tertiaryContainerVariant, structuralEqualityPolicy()) + val background by mutableStateOf(background, structuralEqualityPolicy()) + val onBackground by mutableStateOf(onBackground, structuralEqualityPolicy()) + val onBackgroundVariant by mutableStateOf(onBackgroundVariant, structuralEqualityPolicy()) + val surface by mutableStateOf(surface, structuralEqualityPolicy()) + val onSurface by mutableStateOf(onSurface, structuralEqualityPolicy()) + val surfaceVariant by mutableStateOf(surfaceVariant, structuralEqualityPolicy()) + val onSurfaceVariantDialog by mutableStateOf(onSurfaceVariantDialog, structuralEqualityPolicy()) + val onSurfaceVariantSummary by mutableStateOf(onSurfaceVariantSummary, structuralEqualityPolicy()) + val onSurfaceVariantActions by mutableStateOf(onSurfaceVariantActions, structuralEqualityPolicy()) + val disabledOnSurface by mutableStateOf(disabledOnSurface, structuralEqualityPolicy()) + val outline by mutableStateOf(outline, structuralEqualityPolicy()) + val dividerLine by mutableStateOf(dividerLine, structuralEqualityPolicy()) + val surfaceContainer by mutableStateOf(surfaceContainer, structuralEqualityPolicy()) + val onSurfaceContainer by mutableStateOf(onSurfaceContainer, structuralEqualityPolicy()) + val onSurfaceContainerVariant by mutableStateOf(onSurfaceContainerVariant, structuralEqualityPolicy()) + val surfaceContainerHigh by mutableStateOf(surfaceContainerHigh, structuralEqualityPolicy()) + val onSurfaceContainerHigh by mutableStateOf(onSurfaceContainerHigh, structuralEqualityPolicy()) + val surfaceContainerHighest by mutableStateOf(surfaceContainerHighest, structuralEqualityPolicy()) + val onSurfaceContainerHighest by mutableStateOf(onSurfaceContainerHighest, structuralEqualityPolicy()) } fun lightColorScheme() = MiuixColor( primary = Color(0xFF3482FF), - onPrimary = Color.Black, - primaryContainer = Color.White, - background = Color(0xFFF7F7F7), - onBackground = Color.Black, - subTextBase = Color(0xFF666666), - secondary = Color(0xFFE6E6E6), - dropdownBackground = Color(0xFFFFFFFF), - dropdownSelect = Color(0xFFEAF2FF), - searchBarBg = Color(0xFFEDEDED), - searchBarSub = Color(0xFFA5A5A5), - textFieldBg = Color(0xFFF0F0F0), - textFieldSub = Color(0xFFA8A8A8), + onPrimary = Color.White, + primaryVariant = Color(0xFF3482FF), + onPrimaryVariant = Color(0xFFAECDFF), disabledPrimary = Color(0xFFC2D9FF), + disabledOnPrimary = Color(0xFFEDF4FF), + disabledPrimaryButton = Color(0xFFEBF1FD), + disabledOnPrimaryButton = Color(0xFFFAFAFF), + disabledPrimarySlider = Color(0xFFB4D1FF), + primaryContainer = Color(0xFF5D9BFF), + onPrimaryContainer = Color.White, + secondary = Color(0xFFE6E6E6), + onSecondary = Color.White, + secondaryVariant = Color(0xFFF0F0F0), + onSecondaryVariant = Color(0xFF303030), disabledSecondary = Color(0xFFF2F2F2), - onDisabledPrimary = Color(0xFFEDF4FF), - onDisabledSecondary = Color(0xFFFCFCFC), - smallTitle = Color(0xFF8C93B0) + disabledOnSecondary = Color(0xFFFCFCFC), + disabledSecondaryVariant = Color(0xFFF5F5F5), + disabledOnSecondaryVariant = Color(0xFFB2B2B2), + secondaryContainer = Color(0xFFF0F0F0), + onSecondaryContainer = Color(0xFFA9A9A9), + secondaryContainerVariant = Color(0xFFF0F0F0), + onSecondaryContainerVariant = Color(0xFFA9A9A9), + tertiaryContainer = Color(0xFFEBF3FF), + onTertiaryContainer = Color(0xFF3482FF), + tertiaryContainerVariant = Color(0xFFEBF3FF), + background = Color(0xFFF7F7F7), + onBackground = Color.Black, + onBackgroundVariant = Color(0xFF8C93B0), + surface = Color.White, + onSurface = Color.Black, + surfaceVariant = Color.White, + onSurfaceVariantDialog = Color(0xFF333333), + onSurfaceVariantSummary = Color(0xFF666666), + onSurfaceVariantActions = Color(0xFF999999), + disabledOnSurface = Color(0xFFB2B2B2), + outline = Color(0xFFD9D9D9), + dividerLine = Color(0xFFE0E0E0), + surfaceContainer = Color(0xFFF9F9F9), + onSurfaceContainer = Color(0xFF323232), + onSurfaceContainerVariant = Color(0xFF959595), + surfaceContainerHigh = Color(0xFFEDEDED), + onSurfaceContainerHigh = Color(0xFFA5A5A5), + surfaceContainerHighest = Color(0xFFE8E8E8), + onSurfaceContainerHighest = Color.Black ) fun darkColorScheme() = MiuixColor( - primary = Color(0xFF277AF7), + primary = Color(0xFF277Af7), onPrimary = Color.White, - primaryContainer = Color(0xFF242424), - background = Color(0xFF101010), - onBackground = Color(0xFFE9E9E9), - subTextBase = Color(0xFF929292), - secondary = Color(0xFF505050), - dropdownBackground = Color(0xFF2C2C2C), - dropdownSelect = Color(0xFF2B3B54), - searchBarBg = Color(0xFF2D2D2D), - searchBarSub = Color(0xFF6C6C6C), - textFieldBg = Color(0xFF2C2C2C), - textFieldSub = Color(0xFF6C6C6C), + primaryVariant = Color(0xFF0073DD), + onPrimaryVariant = Color(0xFF99C7F1), disabledPrimary = Color(0xFF253E64), - disabledSecondary = Color(0xFF404040), - onDisabledPrimary = Color(0xFF677993), - onDisabledSecondary = Color(0xFF707070), - smallTitle = Color(0xFF787E96) + disabledOnPrimary = Color(0xFF677993), + disabledPrimaryButton = Color(0xFF1E2B43), + disabledOnPrimaryButton = Color(0xFF505A6E), + disabledPrimarySlider = Color(0xFF435C81), + primaryContainer = Color(0xFF338FE4), + onPrimaryContainer = Color.White, + secondary = Color(0xFF4F4F4F), + onSecondary = Color.White, + secondaryVariant = Color(0xFF3A3A3A), + onSecondaryVariant = Color(0xFFAAAAAA), + disabledSecondary = Color(0xFF3F3F3F), + disabledOnSecondary = Color(0xFF707070), + disabledSecondaryVariant = Color(0xFF434343), + disabledOnSecondaryVariant = Color(0xFF646464), + secondaryContainer = Color(0xFF2C2C2C), + onSecondaryContainer = Color(0xFF5D5D5D), + secondaryContainerVariant = Color(0xFF4F4F4F), + onSecondaryContainerVariant = Color(0xFF959595), + tertiaryContainer = Color(0xFF2B3B54), + onTertiaryContainer = Color(0xFF277AF7), + tertiaryContainerVariant = Color(0xFF4F4F4F), + background = Color(0xFF101010), + onBackground = Color(0xFFE8E8E8), + onBackgroundVariant = Color(0xFF787E96), + surface = Color(0xFF242424), + onSurface = Color(0xFFE9E9E9), + surfaceVariant = Color(0xFF181818), + onSurfaceVariantDialog = Color(0xFFD2D2D2), + onSurfaceVariantSummary = Color(0xFF929292), + onSurfaceVariantActions = Color(0xFF7B7B7B), + disabledOnSurface = Color(0xFF666666), + outline = Color(0xFF404040), + dividerLine = Color(0xFF393939), + surfaceContainer = Color(0xFF161616), + onSurfaceContainer = Color(0xFFD0D0D0), + onSurfaceContainerVariant = Color(0xFF737373), + surfaceContainerHigh = Color(0xFF2D2D2D), + onSurfaceContainerHigh = Color(0xFF6C6C6C), + surfaceContainerHighest = Color(0xFF2D2D2D), + onSurfaceContainerHighest = Color(0xFFE9E9E9) ) \ No newline at end of file diff --git a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixTheme.kt b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixTheme.kt index b116e963..ed28cd3a 100644 --- a/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixTheme.kt +++ b/miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/theme/MiuixTheme.kt @@ -22,11 +22,11 @@ fun MiuixTheme( textStyles: MiuixTextStyles = MiuixTheme.textStyles, content: @Composable () -> Unit ) { - val miuixTextStyles = remember(colorScheme.onPrimary) { + val miuixTextStyles = remember(colorScheme.onBackground) { miuixTextStyles( - main = textStyles.main.copy(color = colorScheme.onPrimary), - title = textStyles.title.copy(color = colorScheme.onPrimary), - paragraph = textStyles.paragraph.copy(color = colorScheme.onPrimary) + main = textStyles.main.copy(color = colorScheme.onBackground), + title = textStyles.title.copy(color = colorScheme.onBackground), + paragraph = textStyles.paragraph.copy(color = colorScheme.onBackground) ) } CompositionLocalProvider(