Skip to content

Commit

Permalink
Adds a method to easily provide color resources for light and dark th…
Browse files Browse the repository at this point in the history
…emes
  • Loading branch information
Tweener committed Sep 2, 2024
1 parent eeae156 commit a0c033e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/ProjectConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object ProjectConfiguration {

object Czan {
const val packageName = "com.tweener.czan"
const val versionName = "2.3.2"
const val versionName = "2.3.3"
const val namespace = "$packageName.android"
const val compileSDK = 34
const val minSDK = 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Shapes
import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import io.github.alexzhirkevich.cupertino.adaptive.AdaptiveTheme
import io.github.alexzhirkevich.cupertino.adaptive.ExperimentalAdaptiveApi
import io.github.alexzhirkevich.cupertino.adaptive.Theme
Expand All @@ -16,6 +17,10 @@ import io.github.alexzhirkevich.cupertino.theme.CupertinoTheme
* @since 26/09/2023
*/

@Composable
fun colorResource(colorLight: Color, colorDark: Color = Color.Unspecified) =
if (isSystemInDarkTheme()) colorDark else colorLight

expect fun determineTheme(): Theme

@OptIn(ExperimentalAdaptiveApi::class)
Expand Down

0 comments on commit a0c033e

Please sign in to comment.