package com.tt.honeyDue.ui.theme

import android.os.Build
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext

/**
 * Android actual: dynamic color (Material You) is available on Android 12+
 * (API 31, [Build.VERSION_CODES.S]).
 */
actual fun isDynamicColorSupported(): Boolean =
    Build.VERSION.SDK_INT >= Build.VERSION_CODES.S

@Composable
actual fun rememberDynamicColorScheme(darkTheme: Boolean): ColorScheme? {
    if (!isDynamicColorSupported()) return null
    val context = LocalContext.current
    return if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
