Skip to content

Commit

Permalink
Update default color scheme
Browse files Browse the repository at this point in the history
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam committed May 1, 2024
1 parent c1f32ed commit 5426990
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 117 deletions.
12 changes: 6 additions & 6 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ private fun ThemeBottomSheet(
onThemeChange: (ThemeMode) -> Unit,
onAmoledThemeChange: (Boolean) -> Unit,
) {
val view = LocalView.current
val context = LocalContext.current
val coroutineScope = rememberCoroutineScope()
val themeRadioOptions = listOf(
Expand Down Expand Up @@ -345,6 +346,7 @@ private fun ThemeBottomSheet(
Switch(
checked = amoledThemeValue,
onCheckedChange = {
view.weakHapticFeedback()
onAmoledThemeChange(it)
},
thumbContent = if (amoledThemeValue) {
Expand Down
122 changes: 70 additions & 52 deletions app/src/main/java/com/starry/greenstash/ui/theme/Color.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,74 @@ package com.starry.greenstash.ui.theme

import androidx.compose.ui.graphics.Color

val md_theme_light_primary = Color(0xFF006D38)
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
val md_theme_light_primaryContainer = Color(0xFF71FDA2)
val md_theme_light_onPrimaryContainer = Color(0xFF00210D)
val md_theme_light_secondary = Color(0xFF506353)
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
val md_theme_light_secondaryContainer = Color(0xFFD2E8D3)
val md_theme_light_onSecondaryContainer = Color(0xFF0D1F12)
val md_theme_light_tertiary = Color(0xFF3A656F)
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
val md_theme_light_tertiaryContainer = Color(0xFFBEEAF6)
val md_theme_light_onTertiaryContainer = Color(0xFF001F25)
val md_theme_light_error = Color(0xFFBA1A1A)
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
val md_theme_light_onError = Color(0xFFFFFFFF)
val md_theme_light_onErrorContainer = Color(0xFF410002)
val md_theme_light_background = Color(0xFFFBFDF7)
val md_theme_light_onBackground = Color(0xFF191C19)
val md_theme_light_surface = Color(0xFFFBFDF7)
val md_theme_light_onSurface = Color(0xFF191C19)
val md_theme_light_surfaceVariant = Color(0xFFDDE5DB)
val md_theme_light_onSurfaceVariant = Color(0xFF414941)
val md_theme_light_outline = Color(0xFF717971)
val md_theme_light_inverseOnSurface = Color(0xFFF0F1EC)
val md_theme_light_inverseSurface = Color(0xFF2E312E)
val md_theme_light_inversePrimary = Color(0xFF51E088)
val primaryLight = Color(0xFF316A42)
val onPrimaryLight = Color(0xFFFFFFFF)
val primaryContainerLight = Color(0xFFB3F1BE)
val onPrimaryContainerLight = Color(0xFF00210C)
val secondaryLight = Color(0xFF506352)
val onSecondaryLight = Color(0xFFFFFFFF)
val secondaryContainerLight = Color(0xFFD3E8D3)
val onSecondaryContainerLight = Color(0xFF0E1F12)
val tertiaryLight = Color(0xFF3A656E)
val onTertiaryLight = Color(0xFFFFFFFF)
val tertiaryContainerLight = Color(0xFFBDEAF5)
val onTertiaryContainerLight = Color(0xFF001F25)
val errorLight = Color(0xFFBA1A1A)
val onErrorLight = Color(0xFFFFFFFF)
val errorContainerLight = Color(0xFFFFDAD6)
val onErrorContainerLight = Color(0xFF410002)
val backgroundLight = Color(0xFFF6FBF3)
val onBackgroundLight = Color(0xFF181D18)
val surfaceLight = Color(0xFFF6FBF3)
val onSurfaceLight = Color(0xFF181D18)
val surfaceVariantLight = Color(0xFFDDE5DA)
val onSurfaceVariantLight = Color(0xFF414941)
val outlineLight = Color(0xFF717971)
val outlineVariantLight = Color(0xFFC1C9BF)
val scrimLight = Color(0xFF000000)
val inverseSurfaceLight = Color(0xFF2D322D)
val inverseOnSurfaceLight = Color(0xFFEEF2EA)
val inversePrimaryLight = Color(0xFF98D4A4)
val surfaceDimLight = Color(0xFFD7DBD4)
val surfaceBrightLight = Color(0xFFF6FBF3)
val surfaceContainerLowestLight = Color(0xFFFFFFFF)
val surfaceContainerLowLight = Color(0xFFF0F5ED)
val surfaceContainerLight = Color(0xFFEBEFE7)
val surfaceContainerHighLight = Color(0xFFE5EAE2)
val surfaceContainerHighestLight = Color(0xFFDFE4DC)

val md_theme_dark_primary = Color(0xFF51E088)
val md_theme_dark_onPrimary = Color(0xFF00391B)
val md_theme_dark_primaryContainer = Color(0xFF005229)
val md_theme_dark_onPrimaryContainer = Color(0xFF71FDA2)
val md_theme_dark_secondary = Color(0xFFB6CCB8)
val md_theme_dark_onSecondary = Color(0xFF223526)
val md_theme_dark_secondaryContainer = Color(0xFF384B3C)
val md_theme_dark_onSecondaryContainer = Color(0xFFD2E8D3)
val md_theme_dark_tertiary = Color(0xFFA2CED9)
val md_theme_dark_onTertiary = Color(0xFF01363F)
val md_theme_dark_tertiaryContainer = Color(0xFF204D56)
val md_theme_dark_onTertiaryContainer = Color(0xFFBEEAF6)
val md_theme_dark_error = Color(0xFFFFB4AB)
val md_theme_dark_errorContainer = Color(0xFF93000A)
val md_theme_dark_onError = Color(0xFF690005)
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
val md_theme_dark_background = Color(0xFF191C19)
val md_theme_dark_onBackground = Color(0xFFE1E3DE)
val md_theme_dark_surface = Color(0xFF191C19)
val md_theme_dark_onSurface = Color(0xFFE1E3DE)
val md_theme_dark_surfaceVariant = Color(0xFF414941)
val md_theme_dark_onSurfaceVariant = Color(0xFFC1C9BF)
val md_theme_dark_outline = Color(0xFF8B938A)
val md_theme_dark_inverseOnSurface = Color(0xFF191C19)
val md_theme_dark_inverseSurface = Color(0xFFE1E3DE)
val md_theme_dark_inversePrimary = Color(0xFF006D38)
val primaryDark = Color(0xFF98D4A4)
val onPrimaryDark = Color(0xFF003919)
val primaryContainerDark = Color(0xFF16512C)
val onPrimaryContainerDark = Color(0xFFB3F1BE)
val secondaryDark = Color(0xFFB7CCB7)
val onSecondaryDark = Color(0xFF233426)
val secondaryContainerDark = Color(0xFF394B3B)
val onSecondaryContainerDark = Color(0xFFD3E8D3)
val tertiaryDark = Color(0xFFA2CED9)
val onTertiaryDark = Color(0xFF01363F)
val tertiaryContainerDark = Color(0xFF204D56)
val onTertiaryContainerDark = Color(0xFFBDEAF5)
val errorDark = Color(0xFFFFB4AB)
val onErrorDark = Color(0xFF690005)
val errorContainerDark = Color(0xFF93000A)
val onErrorContainerDark = Color(0xFFFFDAD6)
val backgroundDark = Color(0xFF101510)
val onBackgroundDark = Color(0xFFDFE4DC)
val surfaceDark = Color(0xFF101510)
val onSurfaceDark = Color(0xFFDFE4DC)
val surfaceVariantDark = Color(0xFF414941)
val onSurfaceVariantDark = Color(0xFFC1C9BF)
val outlineDark = Color(0xFF8B938A)
val outlineVariantDark = Color(0xFF414941)
val scrimDark = Color(0xFF000000)
val inverseSurfaceDark = Color(0xFFDFE4DC)
val inverseOnSurfaceDark = Color(0xFF2D322D)
val inversePrimaryDark = Color(0xFF316A42)
val surfaceDimDark = Color(0xFF101510)
val surfaceBrightDark = Color(0xFF353A35)
val surfaceContainerLowestDark = Color(0xFF0B0F0B)
val surfaceContainerLowDark = Color(0xFF181D18)
val surfaceContainerDark = Color(0xFF1C211C)
val surfaceContainerHighDark = Color(0xFF262B26)
val surfaceContainerHighestDark = Color(0xFF313631)
136 changes: 77 additions & 59 deletions app/src/main/java/com/starry/greenstash/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,66 +42,84 @@ import com.starry.greenstash.ui.screens.settings.SettingsViewModel
import com.starry.greenstash.ui.screens.settings.ThemeMode


private val LightColors = lightColorScheme(
onErrorContainer = md_theme_light_onErrorContainer,
onError = md_theme_light_onError,
errorContainer = md_theme_light_errorContainer,
onTertiaryContainer = md_theme_light_onTertiaryContainer,
onTertiary = md_theme_light_onTertiary,
tertiaryContainer = md_theme_light_tertiaryContainer,
tertiary = md_theme_light_tertiary,
error = md_theme_light_error,
outline = md_theme_light_outline,
onBackground = md_theme_light_onBackground,
background = md_theme_light_background,
inverseOnSurface = md_theme_light_inverseOnSurface,
inverseSurface = md_theme_light_inverseSurface,
onSurfaceVariant = md_theme_light_onSurfaceVariant,
onSurface = md_theme_light_onSurface,
surfaceVariant = md_theme_light_surfaceVariant,
surface = md_theme_light_surface,
onSecondaryContainer = md_theme_light_onSecondaryContainer,
onSecondary = md_theme_light_onSecondary,
secondaryContainer = md_theme_light_secondaryContainer,
secondary = md_theme_light_secondary,
inversePrimary = md_theme_light_inversePrimary,
onPrimaryContainer = md_theme_light_onPrimaryContainer,
onPrimary = md_theme_light_onPrimary,
primaryContainer = md_theme_light_primaryContainer,
primary = md_theme_light_primary,
private val lightColors = lightColorScheme(
primary = primaryLight,
onPrimary = onPrimaryLight,
primaryContainer = primaryContainerLight,
onPrimaryContainer = onPrimaryContainerLight,
secondary = secondaryLight,
onSecondary = onSecondaryLight,
secondaryContainer = secondaryContainerLight,
onSecondaryContainer = onSecondaryContainerLight,
tertiary = tertiaryLight,
onTertiary = onTertiaryLight,
tertiaryContainer = tertiaryContainerLight,
onTertiaryContainer = onTertiaryContainerLight,
error = errorLight,
onError = onErrorLight,
errorContainer = errorContainerLight,
onErrorContainer = onErrorContainerLight,
background = backgroundLight,
onBackground = onBackgroundLight,
surface = surfaceLight,
onSurface = onSurfaceLight,
surfaceVariant = surfaceVariantLight,
onSurfaceVariant = onSurfaceVariantLight,
outline = outlineLight,
outlineVariant = outlineVariantLight,
scrim = scrimLight,
inverseSurface = inverseSurfaceLight,
inverseOnSurface = inverseOnSurfaceLight,
inversePrimary = inversePrimaryLight,
surfaceDim = surfaceDimLight,
surfaceBright = surfaceBrightLight,
surfaceContainerLowest = surfaceContainerLowestLight,
surfaceContainerLow = surfaceContainerLowLight,
surfaceContainer = surfaceContainerLight,
surfaceContainerHigh = surfaceContainerHighLight,
surfaceContainerHighest = surfaceContainerHighestLight,
)


private val DarkColors = darkColorScheme(
onErrorContainer = md_theme_dark_onErrorContainer,
onError = md_theme_dark_onError,
errorContainer = md_theme_dark_errorContainer,
onTertiaryContainer = md_theme_dark_onTertiaryContainer,
onTertiary = md_theme_dark_onTertiary,
tertiaryContainer = md_theme_dark_tertiaryContainer,
tertiary = md_theme_dark_tertiary,
error = md_theme_dark_error,
outline = md_theme_dark_outline,
onBackground = md_theme_dark_onBackground,
background = md_theme_dark_background,
inverseOnSurface = md_theme_dark_inverseOnSurface,
inverseSurface = md_theme_dark_inverseSurface,
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
onSurface = md_theme_dark_onSurface,
surfaceVariant = md_theme_dark_surfaceVariant,
surface = md_theme_dark_surface,
onSecondaryContainer = md_theme_dark_onSecondaryContainer,
onSecondary = md_theme_dark_onSecondary,
secondaryContainer = md_theme_dark_secondaryContainer,
secondary = md_theme_dark_secondary,
inversePrimary = md_theme_dark_inversePrimary,
onPrimaryContainer = md_theme_dark_onPrimaryContainer,
onPrimary = md_theme_dark_onPrimary,
primaryContainer = md_theme_dark_primaryContainer,
primary = md_theme_dark_primary,
private val darkColors = darkColorScheme(
primary = primaryDark,
onPrimary = onPrimaryDark,
primaryContainer = primaryContainerDark,
onPrimaryContainer = onPrimaryContainerDark,
secondary = secondaryDark,
onSecondary = onSecondaryDark,
secondaryContainer = secondaryContainerDark,
onSecondaryContainer = onSecondaryContainerDark,
tertiary = tertiaryDark,
onTertiary = onTertiaryDark,
tertiaryContainer = tertiaryContainerDark,
onTertiaryContainer = onTertiaryContainerDark,
error = errorDark,
onError = onErrorDark,
errorContainer = errorContainerDark,
onErrorContainer = onErrorContainerDark,
background = backgroundDark,
onBackground = onBackgroundDark,
surface = surfaceDark,
onSurface = onSurfaceDark,
surfaceVariant = surfaceVariantDark,
onSurfaceVariant = onSurfaceVariantDark,
outline = outlineDark,
outlineVariant = outlineVariantDark,
scrim = scrimDark,
inverseSurface = inverseSurfaceDark,
inverseOnSurface = inverseOnSurfaceDark,
inversePrimary = inversePrimaryDark,
surfaceDim = surfaceDimDark,
surfaceBright = surfaceBrightDark,
surfaceContainerLowest = surfaceContainerLowestDark,
surfaceContainerLow = surfaceContainerLowDark,
surfaceContainer = surfaceContainerDark,
surfaceContainerHigh = surfaceContainerHighDark,
surfaceContainerHighest = surfaceContainerHighestDark,
)

fun getColorScheme(

private fun getColorScheme(
themeState: ThemeMode,
materialYouState: Boolean,
amoledTheme: Boolean,
Expand All @@ -112,19 +130,19 @@ fun getColorScheme(
ThemeMode.Light -> if (materialYouState && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
dynamicLightColorScheme(context)
} else {
LightColors
lightColors
}

ThemeMode.Dark -> if (materialYouState && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
dynamicDarkColorScheme(context)
} else {
DarkColors
darkColors
}

ThemeMode.Auto -> if (materialYouState && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
} else {
if (darkTheme) DarkColors else LightColors
if (darkTheme) darkColors else lightColors
}
}

Expand Down

0 comments on commit 5426990

Please sign in to comment.