package net.sergeych.toread

import androidx.compose.runtime.compositionLocalOf
import androidx.compose.ui.graphics.Color

internal val LocalReaderThemeIsDark = compositionLocalOf { false }

internal fun ThemeMode.next(): ThemeMode =
    when (this) {
        ThemeMode.SYSTEM -> ThemeMode.LIGHT
        ThemeMode.LIGHT -> ThemeMode.DARK
        ThemeMode.DARK -> ThemeMode.SYSTEM
    }

internal fun lightReaderColorScheme() = androidx.compose.material3.lightColorScheme(
    primary = Color(0xFF425D56),
    onPrimary = Color.White,
    primaryContainer = Color(0xFFD8E8E2),
    onPrimaryContainer = Color(0xFF17352E),
    secondary = Color(0xFF735B2E),
    secondaryContainer = Color(0xFFF1DDB6),
    tertiary = Color(0xFF7E4A58),
    background = Color(0xFFF7F2EA),
    surface = Color(0xFFFFFBF5),
    surfaceVariant = Color(0xFFE7DFD3),
    onSurface = Color(0xFF24211D),
    inverseSurface = Color(0xFF3A322C),
    inverseOnSurface = Color(0xFFF7F2EA),
    inversePrimary = Color(0xFFAFCFC4),
    outline = Color(0xFF8C8174),
)

internal fun darkReaderColorScheme() = androidx.compose.material3.darkColorScheme(
    primary = Color(0xFFAFCFC4),
    onPrimary = Color(0xFF18352E),
    primaryContainer = Color(0xFF2B4941),
    onPrimaryContainer = Color(0xFFD8E8E2),
    secondary = Color(0xFFE2C58F),
    secondaryContainer = Color(0xFF59431B),
    tertiary = Color(0xFFE9B8C3),
    background = Color(0xFF171411),
    surface = Color(0xFF211D19),
    surfaceVariant = Color(0xFF4E463D),
    onSurface = Color(0xFFECE0D4),
    inverseSurface = Color(0xFFECE0D4),
    inverseOnSurface = Color(0xFF24211D),
    inversePrimary = Color(0xFF425D56),
    outline = Color(0xFFA99E91),
)
