From 79aae019d8813f7cb387d49da39045a996c54f6b Mon Sep 17 00:00:00 2001 From: christianrowlands Date: Fri, 1 Nov 2024 09:09:20 -0400 Subject: [PATCH] WIP: Initial pass at updating the theme to Material 3 --- .../craxiom/networksurvey/ui/theme/Color.kt | 218 +++++++++++++- .../craxiom/networksurvey/ui/theme/NsTheme.kt | 2 +- .../craxiom/networksurvey/ui/theme/Theme.kt | 276 ++++++++++++++++++ .../craxiom/networksurvey/ui/theme/Type.kt | 5 + networksurvey/src/main/res/values/colors.xml | 142 +++++++++ networksurvey/src/main/res/values/styles.xml | 58 +++- .../src/main/res/values/theme_overlays.xml | 129 ++++++++ 7 files changed, 826 insertions(+), 4 deletions(-) create mode 100644 networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Theme.kt create mode 100644 networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Type.kt create mode 100644 networksurvey/src/main/res/values/theme_overlays.xml diff --git a/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Color.kt b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Color.kt index 8932a982..fee305bd 100644 --- a/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Color.kt +++ b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Color.kt @@ -6,4 +6,220 @@ val ColorBlack = Color(0xFF000000) val ColorOffBlack = Color(0xFF161616) val ColorWhiteCultured = Color(0xFFF4F4F4) val ColorRedFieryRose = Color(0xFFF45B69) -val ColorBlueIceberg = Color(0xFF8BAED0) \ No newline at end of file +val ColorBlueIceberg = Color(0xFF8BAED0) + +val primaryLight = Color(0xFF0F6681) +val onPrimaryLight = Color(0xFFFFFFFF) +val primaryContainerLight = Color(0xFFBCE9FF) +val onPrimaryContainerLight = Color(0xFF001F29) +val secondaryLight = Color(0xFF4D616B) +val onSecondaryLight = Color(0xFFFFFFFF) +val secondaryContainerLight = Color(0xFFD0E6F2) +val onSecondaryContainerLight = Color(0xFF081E27) +val tertiaryLight = Color(0xFF116B56) +val onTertiaryLight = Color(0xFFFFFFFF) +val tertiaryContainerLight = Color(0xFFA3F2D8) +val onTertiaryContainerLight = Color(0xFF002018) +val errorLight = Color(0xFFBA1A1A) +val onErrorLight = Color(0xFFFFFFFF) +val errorContainerLight = Color(0xFFFFDAD6) +val onErrorContainerLight = Color(0xFF410002) +val backgroundLight = Color(0xFFF5FAFD) +val onBackgroundLight = Color(0xFF171C1F) +val surfaceLight = Color(0xFFF5FAFD) +val onSurfaceLight = Color(0xFF171C1F) +val surfaceVariantLight = Color(0xFFDCE4E9) +val onSurfaceVariantLight = Color(0xFF40484C) +val outlineLight = Color(0xFF70787D) +val outlineVariantLight = Color(0xFFC0C8CC) +val scrimLight = Color(0xFF000000) +val inverseSurfaceLight = Color(0xFF2C3134) +val inverseOnSurfaceLight = Color(0xFFEDF1F5) +val inversePrimaryLight = Color(0xFF8AD0EE) +val surfaceDimLight = Color(0xFFD6DBDE) +val surfaceBrightLight = Color(0xFFF5FAFD) +val surfaceContainerLowestLight = Color(0xFFFFFFFF) +val surfaceContainerLowLight = Color(0xFFF0F4F8) +val surfaceContainerLight = Color(0xFFEAEEF2) +val surfaceContainerHighLight = Color(0xFFE4E9EC) +val surfaceContainerHighestLight = Color(0xFFDEE3E6) + +val primaryLightMediumContrast = Color(0xFF00495E) +val onPrimaryLightMediumContrast = Color(0xFFFFFFFF) +val primaryContainerLightMediumContrast = Color(0xFF327D99) +val onPrimaryContainerLightMediumContrast = Color(0xFFFFFFFF) +val secondaryLightMediumContrast = Color(0xFF31464F) +val onSecondaryLightMediumContrast = Color(0xFFFFFFFF) +val secondaryContainerLightMediumContrast = Color(0xFF637882) +val onSecondaryContainerLightMediumContrast = Color(0xFFFFFFFF) +val tertiaryLightMediumContrast = Color(0xFF004C3C) +val onTertiaryLightMediumContrast = Color(0xFFFFFFFF) +val tertiaryContainerLightMediumContrast = Color(0xFF31826C) +val onTertiaryContainerLightMediumContrast = Color(0xFFFFFFFF) +val errorLightMediumContrast = Color(0xFF8C0009) +val onErrorLightMediumContrast = Color(0xFFFFFFFF) +val errorContainerLightMediumContrast = Color(0xFFDA342E) +val onErrorContainerLightMediumContrast = Color(0xFFFFFFFF) +val backgroundLightMediumContrast = Color(0xFFF5FAFD) +val onBackgroundLightMediumContrast = Color(0xFF171C1F) +val surfaceLightMediumContrast = Color(0xFFF5FAFD) +val onSurfaceLightMediumContrast = Color(0xFF171C1F) +val surfaceVariantLightMediumContrast = Color(0xFFDCE4E9) +val onSurfaceVariantLightMediumContrast = Color(0xFF3C4448) +val outlineLightMediumContrast = Color(0xFF586065) +val outlineVariantLightMediumContrast = Color(0xFF747C80) +val scrimLightMediumContrast = Color(0xFF000000) +val inverseSurfaceLightMediumContrast = Color(0xFF2C3134) +val inverseOnSurfaceLightMediumContrast = Color(0xFFEDF1F5) +val inversePrimaryLightMediumContrast = Color(0xFF8AD0EE) +val surfaceDimLightMediumContrast = Color(0xFFD6DBDE) +val surfaceBrightLightMediumContrast = Color(0xFFF5FAFD) +val surfaceContainerLowestLightMediumContrast = Color(0xFFFFFFFF) +val surfaceContainerLowLightMediumContrast = Color(0xFFF0F4F8) +val surfaceContainerLightMediumContrast = Color(0xFFEAEEF2) +val surfaceContainerHighLightMediumContrast = Color(0xFFE4E9EC) +val surfaceContainerHighestLightMediumContrast = Color(0xFFDEE3E6) + +val primaryLightHighContrast = Color(0xFF002632) +val onPrimaryLightHighContrast = Color(0xFFFFFFFF) +val primaryContainerLightHighContrast = Color(0xFF00495E) +val onPrimaryContainerLightHighContrast = Color(0xFFFFFFFF) +val secondaryLightHighContrast = Color(0xFF0F252D) +val onSecondaryLightHighContrast = Color(0xFFFFFFFF) +val secondaryContainerLightHighContrast = Color(0xFF31464F) +val onSecondaryContainerLightHighContrast = Color(0xFFFFFFFF) +val tertiaryLightHighContrast = Color(0xFF00281E) +val onTertiaryLightHighContrast = Color(0xFFFFFFFF) +val tertiaryContainerLightHighContrast = Color(0xFF004C3C) +val onTertiaryContainerLightHighContrast = Color(0xFFFFFFFF) +val errorLightHighContrast = Color(0xFF4E0002) +val onErrorLightHighContrast = Color(0xFFFFFFFF) +val errorContainerLightHighContrast = Color(0xFF8C0009) +val onErrorContainerLightHighContrast = Color(0xFFFFFFFF) +val backgroundLightHighContrast = Color(0xFFF5FAFD) +val onBackgroundLightHighContrast = Color(0xFF171C1F) +val surfaceLightHighContrast = Color(0xFFF5FAFD) +val onSurfaceLightHighContrast = Color(0xFF000000) +val surfaceVariantLightHighContrast = Color(0xFFDCE4E9) +val onSurfaceVariantLightHighContrast = Color(0xFF1D2529) +val outlineLightHighContrast = Color(0xFF3C4448) +val outlineVariantLightHighContrast = Color(0xFF3C4448) +val scrimLightHighContrast = Color(0xFF000000) +val inverseSurfaceLightHighContrast = Color(0xFF2C3134) +val inverseOnSurfaceLightHighContrast = Color(0xFFFFFFFF) +val inversePrimaryLightHighContrast = Color(0xFFD4F0FF) +val surfaceDimLightHighContrast = Color(0xFFD6DBDE) +val surfaceBrightLightHighContrast = Color(0xFFF5FAFD) +val surfaceContainerLowestLightHighContrast = Color(0xFFFFFFFF) +val surfaceContainerLowLightHighContrast = Color(0xFFF0F4F8) +val surfaceContainerLightHighContrast = Color(0xFFEAEEF2) +val surfaceContainerHighLightHighContrast = Color(0xFFE4E9EC) +val surfaceContainerHighestLightHighContrast = Color(0xFFDEE3E6) + +val primaryDark = Color(0xFF8AD0EE) +val onPrimaryDark = Color(0xFF003545) +val primaryContainerDark = Color(0xFF004D63) +val onPrimaryContainerDark = Color(0xFFBCE9FF) +val secondaryDark = Color(0xFFB4CAD5) +val onSecondaryDark = Color(0xFF1E333C) +val secondaryContainerDark = Color(0xFF354A53) +val onSecondaryContainerDark = Color(0xFFD0E6F2) +val tertiaryDark = Color(0xFF87D6BC) +val onTertiaryDark = Color(0xFF00382C) +val tertiaryContainerDark = Color(0xFF005140) +val onTertiaryContainerDark = Color(0xFFA3F2D8) +val errorDark = Color(0xFFFFB4AB) +val onErrorDark = Color(0xFF690005) +val errorContainerDark = Color(0xFF93000A) +val onErrorContainerDark = Color(0xFFFFDAD6) +val backgroundDark = Color(0xFF0F1417) +val onBackgroundDark = Color(0xFFDEE3E6) +val surfaceDark = Color(0xFF0F1417) +val onSurfaceDark = Color(0xFFDEE3E6) +val surfaceVariantDark = Color(0xFF40484C) +val onSurfaceVariantDark = Color(0xFFC0C8CC) +val outlineDark = Color(0xFF8A9296) +val outlineVariantDark = Color(0xFF40484C) +val scrimDark = Color(0xFF000000) +val inverseSurfaceDark = Color(0xFFDEE3E6) +val inverseOnSurfaceDark = Color(0xFF2C3134) +val inversePrimaryDark = Color(0xFF0F6681) +val surfaceDimDark = Color(0xFF0F1417) +val surfaceBrightDark = Color(0xFF353A3D) +val surfaceContainerLowestDark = Color(0xFF0A0F11) +val surfaceContainerLowDark = Color(0xFF171C1F) +val surfaceContainerDark = Color(0xFF1B2023) +val surfaceContainerHighDark = Color(0xFF262B2D) +val surfaceContainerHighestDark = Color(0xFF303538) + +val primaryDarkMediumContrast = Color(0xFF8ED4F3) +val onPrimaryDarkMediumContrast = Color(0xFF001922) +val primaryContainerDarkMediumContrast = Color(0xFF5299B6) +val onPrimaryContainerDarkMediumContrast = Color(0xFF000000) +val secondaryDarkMediumContrast = Color(0xFFB8CEDA) +val onSecondaryDarkMediumContrast = Color(0xFF031921) +val secondaryContainerDarkMediumContrast = Color(0xFF7E949F) +val onSecondaryContainerDarkMediumContrast = Color(0xFF000000) +val tertiaryDarkMediumContrast = Color(0xFF8BDAC1) +val onTertiaryDarkMediumContrast = Color(0xFF001B13) +val tertiaryContainerDarkMediumContrast = Color(0xFF509F88) +val onTertiaryContainerDarkMediumContrast = Color(0xFF000000) +val errorDarkMediumContrast = Color(0xFFFFBAB1) +val onErrorDarkMediumContrast = Color(0xFF370001) +val errorContainerDarkMediumContrast = Color(0xFFFF5449) +val onErrorContainerDarkMediumContrast = Color(0xFF000000) +val backgroundDarkMediumContrast = Color(0xFF0F1417) +val onBackgroundDarkMediumContrast = Color(0xFFDEE3E6) +val surfaceDarkMediumContrast = Color(0xFF0F1417) +val onSurfaceDarkMediumContrast = Color(0xFFF7FBFF) +val surfaceVariantDarkMediumContrast = Color(0xFF40484C) +val onSurfaceVariantDarkMediumContrast = Color(0xFFC4CCD1) +val outlineDarkMediumContrast = Color(0xFF9CA4A9) +val outlineVariantDarkMediumContrast = Color(0xFF7C8489) +val scrimDarkMediumContrast = Color(0xFF000000) +val inverseSurfaceDarkMediumContrast = Color(0xFFDEE3E6) +val inverseOnSurfaceDarkMediumContrast = Color(0xFF262B2D) +val inversePrimaryDarkMediumContrast = Color(0xFF004E65) +val surfaceDimDarkMediumContrast = Color(0xFF0F1417) +val surfaceBrightDarkMediumContrast = Color(0xFF353A3D) +val surfaceContainerLowestDarkMediumContrast = Color(0xFF0A0F11) +val surfaceContainerLowDarkMediumContrast = Color(0xFF171C1F) +val surfaceContainerDarkMediumContrast = Color(0xFF1B2023) +val surfaceContainerHighDarkMediumContrast = Color(0xFF262B2D) +val surfaceContainerHighestDarkMediumContrast = Color(0xFF303538) + +val primaryDarkHighContrast = Color(0xFFF6FBFF) +val onPrimaryDarkHighContrast = Color(0xFF000000) +val primaryContainerDarkHighContrast = Color(0xFF8ED4F3) +val onPrimaryContainerDarkHighContrast = Color(0xFF000000) +val secondaryDarkHighContrast = Color(0xFFF6FBFF) +val onSecondaryDarkHighContrast = Color(0xFF000000) +val secondaryContainerDarkHighContrast = Color(0xFFB8CEDA) +val onSecondaryContainerDarkHighContrast = Color(0xFF000000) +val tertiaryDarkHighContrast = Color(0xFFECFFF6) +val onTertiaryDarkHighContrast = Color(0xFF000000) +val tertiaryContainerDarkHighContrast = Color(0xFF8BDAC1) +val onTertiaryContainerDarkHighContrast = Color(0xFF000000) +val errorDarkHighContrast = Color(0xFFFFF9F9) +val onErrorDarkHighContrast = Color(0xFF000000) +val errorContainerDarkHighContrast = Color(0xFFFFBAB1) +val onErrorContainerDarkHighContrast = Color(0xFF000000) +val backgroundDarkHighContrast = Color(0xFF0F1417) +val onBackgroundDarkHighContrast = Color(0xFFDEE3E6) +val surfaceDarkHighContrast = Color(0xFF0F1417) +val onSurfaceDarkHighContrast = Color(0xFFFFFFFF) +val surfaceVariantDarkHighContrast = Color(0xFF40484C) +val onSurfaceVariantDarkHighContrast = Color(0xFFF6FBFF) +val outlineDarkHighContrast = Color(0xFFC4CCD1) +val outlineVariantDarkHighContrast = Color(0xFFC4CCD1) +val scrimDarkHighContrast = Color(0xFF000000) +val inverseSurfaceDarkHighContrast = Color(0xFFDEE3E6) +val inverseOnSurfaceDarkHighContrast = Color(0xFF000000) +val inversePrimaryDarkHighContrast = Color(0xFF002E3D) +val surfaceDimDarkHighContrast = Color(0xFF0F1417) +val surfaceBrightDarkHighContrast = Color(0xFF353A3D) +val surfaceContainerLowestDarkHighContrast = Color(0xFF0A0F11) +val surfaceContainerLowDarkHighContrast = Color(0xFF171C1F) +val surfaceContainerDarkHighContrast = Color(0xFF1B2023) +val surfaceContainerHighDarkHighContrast = Color(0xFF262B2D) +val surfaceContainerHighestDarkHighContrast = Color(0xFF303538) diff --git a/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/NsTheme.kt b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/NsTheme.kt index 5f2c3741..c37082d8 100644 --- a/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/NsTheme.kt +++ b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/NsTheme.kt @@ -62,7 +62,7 @@ private val LightColorScheme = lightColorScheme( ) @Composable -fun NsTheme( +fun OldNsTheme( darkTheme: Boolean = true, content: @Composable () -> Unit ) { diff --git a/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Theme.kt b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Theme.kt new file mode 100644 index 00000000..7a6a8f7c --- /dev/null +++ b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Theme.kt @@ -0,0 +1,276 @@ +package com.craxiom.networksurvey.ui.theme + +import android.os.Build +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalContext + +private val lightScheme = 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 darkScheme = 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, +) + +private val mediumContrastLightColorScheme = lightColorScheme( + primary = primaryLightMediumContrast, + onPrimary = onPrimaryLightMediumContrast, + primaryContainer = primaryContainerLightMediumContrast, + onPrimaryContainer = onPrimaryContainerLightMediumContrast, + secondary = secondaryLightMediumContrast, + onSecondary = onSecondaryLightMediumContrast, + secondaryContainer = secondaryContainerLightMediumContrast, + onSecondaryContainer = onSecondaryContainerLightMediumContrast, + tertiary = tertiaryLightMediumContrast, + onTertiary = onTertiaryLightMediumContrast, + tertiaryContainer = tertiaryContainerLightMediumContrast, + onTertiaryContainer = onTertiaryContainerLightMediumContrast, + error = errorLightMediumContrast, + onError = onErrorLightMediumContrast, + errorContainer = errorContainerLightMediumContrast, + onErrorContainer = onErrorContainerLightMediumContrast, + background = backgroundLightMediumContrast, + onBackground = onBackgroundLightMediumContrast, + surface = surfaceLightMediumContrast, + onSurface = onSurfaceLightMediumContrast, + surfaceVariant = surfaceVariantLightMediumContrast, + onSurfaceVariant = onSurfaceVariantLightMediumContrast, + outline = outlineLightMediumContrast, + outlineVariant = outlineVariantLightMediumContrast, + scrim = scrimLightMediumContrast, + inverseSurface = inverseSurfaceLightMediumContrast, + inverseOnSurface = inverseOnSurfaceLightMediumContrast, + inversePrimary = inversePrimaryLightMediumContrast, + surfaceDim = surfaceDimLightMediumContrast, + surfaceBright = surfaceBrightLightMediumContrast, + surfaceContainerLowest = surfaceContainerLowestLightMediumContrast, + surfaceContainerLow = surfaceContainerLowLightMediumContrast, + surfaceContainer = surfaceContainerLightMediumContrast, + surfaceContainerHigh = surfaceContainerHighLightMediumContrast, + surfaceContainerHighest = surfaceContainerHighestLightMediumContrast, +) + +private val highContrastLightColorScheme = lightColorScheme( + primary = primaryLightHighContrast, + onPrimary = onPrimaryLightHighContrast, + primaryContainer = primaryContainerLightHighContrast, + onPrimaryContainer = onPrimaryContainerLightHighContrast, + secondary = secondaryLightHighContrast, + onSecondary = onSecondaryLightHighContrast, + secondaryContainer = secondaryContainerLightHighContrast, + onSecondaryContainer = onSecondaryContainerLightHighContrast, + tertiary = tertiaryLightHighContrast, + onTertiary = onTertiaryLightHighContrast, + tertiaryContainer = tertiaryContainerLightHighContrast, + onTertiaryContainer = onTertiaryContainerLightHighContrast, + error = errorLightHighContrast, + onError = onErrorLightHighContrast, + errorContainer = errorContainerLightHighContrast, + onErrorContainer = onErrorContainerLightHighContrast, + background = backgroundLightHighContrast, + onBackground = onBackgroundLightHighContrast, + surface = surfaceLightHighContrast, + onSurface = onSurfaceLightHighContrast, + surfaceVariant = surfaceVariantLightHighContrast, + onSurfaceVariant = onSurfaceVariantLightHighContrast, + outline = outlineLightHighContrast, + outlineVariant = outlineVariantLightHighContrast, + scrim = scrimLightHighContrast, + inverseSurface = inverseSurfaceLightHighContrast, + inverseOnSurface = inverseOnSurfaceLightHighContrast, + inversePrimary = inversePrimaryLightHighContrast, + surfaceDim = surfaceDimLightHighContrast, + surfaceBright = surfaceBrightLightHighContrast, + surfaceContainerLowest = surfaceContainerLowestLightHighContrast, + surfaceContainerLow = surfaceContainerLowLightHighContrast, + surfaceContainer = surfaceContainerLightHighContrast, + surfaceContainerHigh = surfaceContainerHighLightHighContrast, + surfaceContainerHighest = surfaceContainerHighestLightHighContrast, +) + +private val mediumContrastDarkColorScheme = darkColorScheme( + primary = primaryDarkMediumContrast, + onPrimary = onPrimaryDarkMediumContrast, + primaryContainer = primaryContainerDarkMediumContrast, + onPrimaryContainer = onPrimaryContainerDarkMediumContrast, + secondary = secondaryDarkMediumContrast, + onSecondary = onSecondaryDarkMediumContrast, + secondaryContainer = secondaryContainerDarkMediumContrast, + onSecondaryContainer = onSecondaryContainerDarkMediumContrast, + tertiary = tertiaryDarkMediumContrast, + onTertiary = onTertiaryDarkMediumContrast, + tertiaryContainer = tertiaryContainerDarkMediumContrast, + onTertiaryContainer = onTertiaryContainerDarkMediumContrast, + error = errorDarkMediumContrast, + onError = onErrorDarkMediumContrast, + errorContainer = errorContainerDarkMediumContrast, + onErrorContainer = onErrorContainerDarkMediumContrast, + background = backgroundDarkMediumContrast, + onBackground = onBackgroundDarkMediumContrast, + surface = surfaceDarkMediumContrast, + onSurface = onSurfaceDarkMediumContrast, + surfaceVariant = surfaceVariantDarkMediumContrast, + onSurfaceVariant = onSurfaceVariantDarkMediumContrast, + outline = outlineDarkMediumContrast, + outlineVariant = outlineVariantDarkMediumContrast, + scrim = scrimDarkMediumContrast, + inverseSurface = inverseSurfaceDarkMediumContrast, + inverseOnSurface = inverseOnSurfaceDarkMediumContrast, + inversePrimary = inversePrimaryDarkMediumContrast, + surfaceDim = surfaceDimDarkMediumContrast, + surfaceBright = surfaceBrightDarkMediumContrast, + surfaceContainerLowest = surfaceContainerLowestDarkMediumContrast, + surfaceContainerLow = surfaceContainerLowDarkMediumContrast, + surfaceContainer = surfaceContainerDarkMediumContrast, + surfaceContainerHigh = surfaceContainerHighDarkMediumContrast, + surfaceContainerHighest = surfaceContainerHighestDarkMediumContrast, +) + +private val highContrastDarkColorScheme = darkColorScheme( + primary = primaryDarkHighContrast, + onPrimary = onPrimaryDarkHighContrast, + primaryContainer = primaryContainerDarkHighContrast, + onPrimaryContainer = onPrimaryContainerDarkHighContrast, + secondary = secondaryDarkHighContrast, + onSecondary = onSecondaryDarkHighContrast, + secondaryContainer = secondaryContainerDarkHighContrast, + onSecondaryContainer = onSecondaryContainerDarkHighContrast, + tertiary = tertiaryDarkHighContrast, + onTertiary = onTertiaryDarkHighContrast, + tertiaryContainer = tertiaryContainerDarkHighContrast, + onTertiaryContainer = onTertiaryContainerDarkHighContrast, + error = errorDarkHighContrast, + onError = onErrorDarkHighContrast, + errorContainer = errorContainerDarkHighContrast, + onErrorContainer = onErrorContainerDarkHighContrast, + background = backgroundDarkHighContrast, + onBackground = onBackgroundDarkHighContrast, + surface = surfaceDarkHighContrast, + onSurface = onSurfaceDarkHighContrast, + surfaceVariant = surfaceVariantDarkHighContrast, + onSurfaceVariant = onSurfaceVariantDarkHighContrast, + outline = outlineDarkHighContrast, + outlineVariant = outlineVariantDarkHighContrast, + scrim = scrimDarkHighContrast, + inverseSurface = inverseSurfaceDarkHighContrast, + inverseOnSurface = inverseOnSurfaceDarkHighContrast, + inversePrimary = inversePrimaryDarkHighContrast, + surfaceDim = surfaceDimDarkHighContrast, + surfaceBright = surfaceBrightDarkHighContrast, + surfaceContainerLowest = surfaceContainerLowestDarkHighContrast, + surfaceContainerLow = surfaceContainerLowDarkHighContrast, + surfaceContainer = surfaceContainerDarkHighContrast, + surfaceContainerHigh = surfaceContainerHighDarkHighContrast, + surfaceContainerHighest = surfaceContainerHighestDarkHighContrast, +) + +@Immutable +data class ColorFamily( + val color: Color, + val onColor: Color, + val colorContainer: Color, + val onColorContainer: Color +) + +val unspecified_scheme = ColorFamily( + Color.Unspecified, Color.Unspecified, Color.Unspecified, Color.Unspecified +) + +@Composable +fun NsTheme( + darkTheme: Boolean = true, + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = false, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> darkScheme + else -> lightScheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = AppTypography, + content = content + ) +} diff --git a/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Type.kt b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Type.kt new file mode 100644 index 00000000..6eb4eebc --- /dev/null +++ b/networksurvey/src/main/java/com/craxiom/networksurvey/ui/theme/Type.kt @@ -0,0 +1,5 @@ +package com.craxiom.networksurvey.ui.theme + +import androidx.compose.material3.Typography + +val AppTypography = Typography() diff --git a/networksurvey/src/main/res/values/colors.xml b/networksurvey/src/main/res/values/colors.xml index 26c1c8ec..ecf68fd0 100644 --- a/networksurvey/src/main/res/values/colors.xml +++ b/networksurvey/src/main/res/values/colors.xml @@ -53,4 +53,146 @@ #000000 #FFFFFF + + #8AD0EE + #003545 + #004D63 + #BCE9FF + #B4CAD5 + #1E333C + #354A53 + #D0E6F2 + #87D6BC + #00382C + #005140 + #A3F2D8 + #FFB4AB + #690005 + #93000A + #FFDAD6 + #1D72A6 + #DEE3E6 + #0F1417 + #DEE3E6 + #40484C + #C0C8CC + #8A9296 + #40484C + #000000 + #DEE3E6 + #2C3134 + #0F6681 + #BCE9FF + #001F29 + #8AD0EE + #004D63 + #D0E6F2 + #081E27 + #B4CAD5 + #354A53 + #A3F2D8 + #002018 + #87D6BC + #005140 + #0F1417 + #353A3D + #0A0F11 + #171C1F + #1B2023 + #262B2D + #303538 + #8ED4F3 + #001922 + #5299B6 + #000000 + #B8CEDA + #031921 + #7E949F + #000000 + #8BDAC1 + #001B13 + #509F88 + #000000 + #FFBAB1 + #370001 + #FF5449 + #000000 + #0F1417 + #DEE3E6 + #0F1417 + #F7FBFF + #40484C + #C4CCD1 + #9CA4A9 + #7C8489 + #000000 + #DEE3E6 + #262B2D + #004E65 + #BCE9FF + #00131B + #8AD0EE + #003B4D + #D0E6F2 + #00131B + #B4CAD5 + #243942 + #A3F2D8 + #00150F + #87D6BC + #003E31 + #0F1417 + #353A3D + #0A0F11 + #171C1F + #1B2023 + #262B2D + #303538 + #F6FBFF + #000000 + #8ED4F3 + #000000 + #F6FBFF + #000000 + #B8CEDA + #000000 + #ECFFF6 + #000000 + #8BDAC1 + #000000 + #FFF9F9 + #000000 + #FFBAB1 + #000000 + #0F1417 + #DEE3E6 + #0F1417 + #FFFFFF + #40484C + #F6FBFF + #C4CCD1 + #C4CCD1 + #000000 + #DEE3E6 + #000000 + #002E3D + #C7EDFF + #000000 + #8ED4F3 + #001922 + #D4EAF6 + #000000 + #B8CEDA + #031921 + #A7F7DC + #000000 + #8BDAC1 + #001B13 + #0F1417 + #353A3D + #0A0F11 + #171C1F + #1B2023 + #262B2D + #303538 diff --git a/networksurvey/src/main/res/values/styles.xml b/networksurvey/src/main/res/values/styles.xml index 8e7f8ca6..21b9aa94 100644 --- a/networksurvey/src/main/res/values/styles.xml +++ b/networksurvey/src/main/res/values/styles.xml @@ -3,7 +3,61 @@ - + + + + +