package com.peachpasswords.ui.theme import androidx.compose.material3.MaterialTheme import androidx.compose.material3.darkColorScheme import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.compositionLocalOf import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp /** Current accent color, available to any composable under [PeachTheme]. */ val LocalPeachAccent = compositionLocalOf { DEFAULT_ACCENT } /** When true, decorative/long-running animations should be skipped or shortened. */ val LocalReduceMotion = staticCompositionLocalOf { false } @Composable fun PeachTheme( accent: Color = DEFAULT_ACCENT, reduceMotion: Boolean = false, content: @Composable () -> Unit, ) { val colors = darkColorScheme( primary = accent, onPrimary = PeachColors.Bg, secondary = PeachColors.SyncBusy, onSecondary = PeachColors.Bg, background = PeachColors.Bg, onBackground = PeachColors.T0, surface = PeachColors.S1, onSurface = PeachColors.T0, surfaceVariant = PeachColors.S2, onSurfaceVariant = PeachColors.T1, outline = PeachColors.T3, error = PeachColors.Breach, onError = PeachColors.Bg, ) val typography = androidx.compose.material3.Typography( bodyLarge = TextStyle( fontFamily = PeachType.Body, fontSize = 16.sp, fontWeight = FontWeight.Normal, ), titleLarge = TextStyle( fontFamily = PeachType.Display, fontSize = 24.sp, fontStyle = FontStyle.Italic, fontWeight = FontWeight.Light, ), labelLarge = TextStyle( fontFamily = PeachType.Body, fontSize = 12.sp, fontWeight = FontWeight.Medium, ), ) CompositionLocalProvider( LocalPeachAccent provides accent, LocalReduceMotion provides reduceMotion, LocalPeachColors provides peachDark(accent), ) { MaterialTheme(colorScheme = colors, typography = typography, content = content) } }