package app.voltplan.cable.ui.theme

import androidx.compose.ui.graphics.Color

// Brand accent — the teal used by the iOS StatsHeaderContainer (RGB 81/144/152).
val CableTeal = Color(0xFF519098)
val CableTealDark = Color(0xFF6FB3BC)

// Component palette — mirrors Color.componentColor(named:) in LoadIconView.swift.
// Approximates Apple's system colors so the Android app reads identically.
val SysBlue = Color(0xFF007AFF)
val SysGreen = Color(0xFF34C759)
val SysOrange = Color(0xFFFF9500)
val SysRed = Color(0xFFFF3B30)
val SysPurple = Color(0xFFAF52DE)
val SysYellow = Color(0xFFFFCC00)
val SysPink = Color(0xFFFF2D55)
val SysTeal = Color(0xFF30B0C7)
val SysIndigo = Color(0xFF5856D6)
val SysMint = Color(0xFF00C7BE)
val SysCyan = Color(0xFF32ADE6)
val SysBrown = Color(0xFFA2845E)
val SysGray = Color(0xFF8E8E93)

/** Maps a stored color name to a SwiftUI-equivalent color. Mirrors `Color.componentColor(named:)`. */
fun componentColor(named: String?): Color = when (named) {
    "blue" -> SysBlue
    "green" -> SysGreen
    "orange" -> SysOrange
    "red" -> SysRed
    "purple" -> SysPurple
    "yellow" -> SysYellow
    "pink" -> SysPink
    "teal" -> SysTeal
    "indigo" -> SysIndigo
    "mint" -> SysMint
    "cyan" -> SysCyan
    "brown" -> SysBrown
    "gray" -> SysGray
    else -> SysBlue
}

/** Ordered list of selectable component colors, matching ItemEditorView's curated palette. */
val curatedColorNames = listOf(
    "blue", "green", "orange", "red", "purple", "yellow",
    "pink", "teal", "indigo", "mint", "cyan", "brown", "gray",
)
