diff --git a/core/designsystem/src/main/java/com/moya/funch/theme/Background.kt b/core/designsystem/src/main/java/com/moya/funch/theme/Background.kt new file mode 100644 index 00000000..245b19f9 --- /dev/null +++ b/core/designsystem/src/main/java/com/moya/funch/theme/Background.kt @@ -0,0 +1,14 @@ +package com.moya.funch.theme + +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.Dp + +@Immutable +data class BackgroundTheme( + val color: Color = Color.Unspecified, + val tonalElevation: Dp = Dp.Unspecified, +) + +val LocalBackgroundTheme = staticCompositionLocalOf { BackgroundTheme() } diff --git a/core/designsystem/src/main/java/com/moya/funch/theme/Gradient.kt b/core/designsystem/src/main/java/com/moya/funch/theme/Gradient.kt new file mode 100644 index 00000000..aed59a1b --- /dev/null +++ b/core/designsystem/src/main/java/com/moya/funch/theme/Gradient.kt @@ -0,0 +1,14 @@ +package com.moya.funch.theme + +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.graphics.Color + +@Immutable +data class GradientColors( + val top: Color = Color.Unspecified, + val bottom: Color = Color.Unspecified, + val container: Color = Color.Unspecified, +) + +val LocalGradientColors = staticCompositionLocalOf { GradientColors() } diff --git a/core/designsystem/src/main/java/com/moya/funch/theme/Theme.kt b/core/designsystem/src/main/java/com/moya/funch/theme/Theme.kt index b32eb0f0..d4b5f395 100644 --- a/core/designsystem/src/main/java/com/moya/funch/theme/Theme.kt +++ b/core/designsystem/src/main/java/com/moya/funch/theme/Theme.kt @@ -1,10 +1,14 @@ package com.moya.funch.theme +import androidx.compose.foundation.layout.Column import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.tooling.preview.Preview private val LocalFunchColors = staticCompositionLocalOf { error("No FunchColors provided") @@ -13,6 +17,11 @@ private val LocalFunchTypography = staticCompositionLocalOf { error("No FunchTypography provided") } +private val DarkGradientColors = + GradientColors(top = Gray900, bottom = Gray900) + +private val DarkAndroidBackgroundTheme = BackgroundTheme(color = Gray900) + object FunchTheme { val colors: FunchColorSchema @Composable get() = LocalFunchColors.current val typography: FunchTypography @Composable get() = LocalFunchTypography.current @@ -39,9 +48,43 @@ fun FunchTheme( ) { // this version provides only dark theme val colors = funchDarkColorSchema() + val gradientColors = DarkGradientColors val typography = funchTypography() - ProvidePophoryColorAndTypography(colors, typography) { - MaterialTheme(content = content) + val backgroundTheme = DarkAndroidBackgroundTheme + + CompositionLocalProvider( + LocalGradientColors provides gradientColors, + LocalBackgroundTheme provides backgroundTheme, + ) { + ProvidePophoryColorAndTypography(colors, typography) { + MaterialTheme(content = content) + } } } +// TODO : 추후 삭제 +@Preview("FunchTheme 예시") +@Composable +private fun NiaThemePreview() { + FunchTheme { + val color = LocalBackgroundTheme.current.color + Surface( + color = color + ) { + Column { + Text( + text = "Hello, Funch!", + color = FunchTheme.colors.white, + style = FunchTheme.typography.t1 + ) + Text( + text = "Hello, Funch!", + color = FunchTheme.colors.white, + style = FunchTheme.typography.sbt1 + ) + } + + } + + } +} diff --git a/core/designsystem/src/main/java/com/moya/funch/theme/Type.kt b/core/designsystem/src/main/java/com/moya/funch/theme/Type.kt index cbf66563..3a172bb9 100644 --- a/core/designsystem/src/main/java/com/moya/funch/theme/Type.kt +++ b/core/designsystem/src/main/java/com/moya/funch/theme/Type.kt @@ -28,8 +28,7 @@ private val spoqaHanSansNeo = FontFamily( R.font.spoqa_han_sans_neo_regular, FontWeight.Normal, FontStyle.Normal - ) - + ), ) @Stable @@ -80,7 +79,7 @@ class FunchTypography internal constructor( } } -fun funchTypography(): FunchTypography { +internal fun funchTypography(): FunchTypography { return FunchTypography( t1 = TextStyle( fontFamily = spoqaHanSansNeo,