Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD/#6] Design System 기초세팅 #7

Merged
merged 9 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions core/src/main/java/com/terning/core/designsystem/theme/Color.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.terning.core.designsystem.theme

Comment on lines +1 to +2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정 감사합니당~!

import androidx.compose.ui.graphics.Color

// Grey Scale
val White = Color(0xFFFFFFFF)
val Grey100 = Color(0xFFF5F5F5)
val Grey150 = Color(0xFFE9E9E9)
val Grey200 = Color(0xFFDDDDDD)
val Grey300 = Color(0xFFBCBCBC)
val Grey350 = Color(0xFFADADAD)
val Grey400 = Color(0xFF666666)
val Grey500 = Color(0xFF373737)
val Black = Color(0xFF171717)

// Main Color
val TerningMain = Color(0xFF1EA65E)

// Calendar Color
val CalRed = Color(0xFFED4E54)

val CalOrange1 = Color(0xFFEE7647)
val CalOrange2 = Color(0xFF5397F3)

val CalYellow = Color(0xFFF5E660)

val CalGreen1 = Color(0xFFC4E953)
val CalGreen2 = Color(0xFF84D558)

val CalBlue1 = Color(0xFF45D0CC)
val CalBlue2 = Color(0xFF4119F2)

val CalPurple = Color(0xFF9B64E2)

val CalPink = Color(0xFFF260AC)

// Other
val WarningRed = Color(0xFFF54645)
val SundayRed = Color(0xFFEB1211)
51 changes: 51 additions & 0 deletions core/src/main/java/com/terning/core/designsystem/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.terning.core.designsystem.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.runtime.staticCompositionLocalOf

private val LightColorScheme = lightColorScheme(
primary = TerningMain,
)

private val LocalTerningTypography = staticCompositionLocalOf<TerningTypography> {
error("No TerningTypography provided")
}

object TerningTheme {
val typography: TerningTypography
@Composable
get() = LocalTerningTypography.current
}

@Composable
fun ProvideTerningTypography(typography: TerningTypography, content: @Composable () -> Unit) {
val provideTypography = remember { typography.copy() }
provideTypography.update(typography)
CompositionLocalProvider(
LocalTerningTypography provides provideTypography,
content = content
)
}

@Composable
fun TerningTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = LightColorScheme
val typography = TerningTypography()

ProvideTerningTypography(typography = typography) {
MaterialTheme(
colorScheme = colorScheme,
content = content,
)
}
}
Loading
Loading