package com.peachpasswords.ui.theme import androidx.compose.runtime.Composable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color /** * A resolved set of Peach colour tokens. Peach is dark-only, so [peachDark] is * the sole factory; the indirection survives because it also carries the live * accent, which the [PeachColors] singleton cannot. * * Accent-derived tints (glow, border, dim …) are NOT stored here: they are the * `Color.peachGlow()` family in AccentColors.kt, computed from the current accent * at the call site so they re-derive whenever the user changes their accent. */ data class PeachPalette( // Backgrounds / surfaces val Bg: Color, val S1: Color, val S2: Color, val S3: Color, val SurfaceCard: Color, val SurfaceElevated: Color, val SettingsGroupBg: Color, // Text hierarchy val T0: Color, val T1: Color, val T2: Color, val T3: Color, val T4: Color, // Accent (the live runtime accent — same value LocalPeachAccent carries) val Accent: Color, // Semantic val Breach: Color, val BreachBg: Color, val BreachBorder: Color, val HealthOk: Color, val TotpTag: Color, val SyncOk: Color, val SyncBusy: Color, val SyncErr: Color, val SyncWarn: Color, // Shell top fade val ShellTopSolid: Color, val ShellTopFade: Color, ) /** * The active palette. Provided by [PeachTheme]; reading it without a surrounding * theme is a programming error (every Peach surface lives under [PeachTheme]). */ val LocalPeachColors = staticCompositionLocalOf { error("No PeachPalette provided — wrap your composable in PeachTheme {}") } /** Convenience accessor — use this everywhere instead of [PeachColors].* */ val peachColors: PeachPalette @Composable get() = LocalPeachColors.current /** The Peach palette: the canonical tokens from [PeachColors] plus the live accent. */ fun peachDark(accent: Color = DEFAULT_ACCENT): PeachPalette = PeachPalette( Bg = PeachColors.Bg, S1 = PeachColors.S1, S2 = PeachColors.S2, S3 = PeachColors.S3, SurfaceCard = PeachColors.SurfaceCard, SurfaceElevated = PeachColors.SurfaceElevated, SettingsGroupBg = PeachColors.SettingsGroupBg, T0 = PeachColors.T0, T1 = PeachColors.T1, T2 = PeachColors.T2, T3 = PeachColors.T3, T4 = PeachColors.T4, Accent = accent, Breach = PeachColors.Breach, BreachBg = PeachColors.BreachBg, BreachBorder = PeachColors.BreachBorder, HealthOk = PeachColors.HealthOk, TotpTag = PeachColors.TotpTag, SyncOk = PeachColors.SyncOk, SyncBusy = PeachColors.SyncBusy, SyncErr = PeachColors.SyncErr, SyncWarn = PeachColors.SyncBusy, ShellTopSolid = PeachColors.ShellTopSolid, ShellTopFade = PeachColors.ShellTopFade, )