import SwiftUI // MARK: - Design Tokens extension Color { // Backgrounds — kein reines Schwarz, sondern Mitternachtsblau static let nightBase = Color(hex: "080810") // Haupt-Hintergrund static let nightSurface = Color(hex: "0E0E1C") // Karten, Sheets static let nightRaised = Color(hex: "151528") // Elevated surfaces static let nightBorder = Color(white: 1, opacity: 0.06) // Text static let nightPrimary = Color(hex: "EEEEF8") static let nightSecondary = Color(hex: "64647A") static let nightTertiary = Color(hex: "3A3A52") // Akzente static let nightPurple = Color(hex: "7B4FE8") static let nightPurpleSoft = Color(hex: "9B77F0") static let nightGreen = Color(hex: "34D399") static let nightRed = Color(hex: "F27474") // Hex initializer init(hex: String) { let h = hex.trimmingCharacters(in: .alphanumerics.inverted) var int: UInt64 = 0 Scanner(string: h).scanHexInt64(&int) let a, r, g, b: UInt64 switch h.count { case 6: (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF) case 8: (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF) default:(a, r, g, b) = (255, 255, 255, 255) } self.init(.sRGB, red: Double(r) / 255, green: Double(g) / 255, blue: Double(b) / 255, opacity: Double(a) / 255) } } // MARK: - Mood (passt hier semantisch besser rein als in Post.swift) extension Mood { var color: Color { switch self { case .still: return Color(hex: "4A9EFF") case .unruhig: return Color(hex: "FF8C42") case .melancholisch: return Color(hex: "A855F7") case .aufgedreht: return Color(hex: "10D08A") } } var label: String { rawValue } var emoji: String { switch self { case .still: return "◌" case .unruhig: return "◎" case .melancholisch: return "◑" case .aufgedreht: return "◉" } } } // MARK: - Typography helpers extension Font { static func nightTitle(_ size: CGFloat) -> Font { .system(size: size, weight: .bold, design: .rounded) } static func nightBody(_ size: CGFloat) -> Font { .system(size: size, weight: .regular) } static func nightMono(_ size: CGFloat) -> Font { .system(size: size, design: .monospaced) } static func nightLabel(_ size: CGFloat, weight: Font.Weight = .medium) -> Font { .system(size: size, weight: weight) } }