-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
507 additions
and
104 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
core/src/main/java/com/terning/core/designsystem/theme/Color.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.terning.core.designsystem.theme | ||
|
||
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
51
core/src/main/java/com/terning/core/designsystem/theme/Theme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) | ||
} | ||
} |
Oops, something went wrong.