49 lines
1.6 KiB
Swift
49 lines
1.6 KiB
Swift
|
|
import SwiftUI
|
||
|
|
|
||
|
|
enum AppTheme {
|
||
|
|
// Brand
|
||
|
|
static let blue = Color(hex: "#2563EB")
|
||
|
|
static let blueLight = Color(hex: "#3B82F6")
|
||
|
|
static let green = Color(hex: "#16A34A")
|
||
|
|
static let greenLight = Color(hex: "#22C55E")
|
||
|
|
static let red = Color(hex: "#DC2626")
|
||
|
|
static let orange = Color(hex: "#EA580C")
|
||
|
|
|
||
|
|
// Backgrounds
|
||
|
|
static let background = Color.white
|
||
|
|
static let cardBackground = Color.white
|
||
|
|
static let cardBorder = Color(hex: "#E5E7EB")
|
||
|
|
|
||
|
|
// Text
|
||
|
|
static let textPrimary = Color(hex: "#111827")
|
||
|
|
static let textSecondary = Color(hex: "#6B7280")
|
||
|
|
static let textTertiary = Color(hex: "#9CA3AF")
|
||
|
|
|
||
|
|
// Status
|
||
|
|
static let connectedBorder = Color(hex: "#16A34A")
|
||
|
|
static let lanBorder = Color(hex: "#2563EB")
|
||
|
|
|
||
|
|
// Typography
|
||
|
|
static let titleFont = Font.system(size: 28, weight: .bold, design: .default)
|
||
|
|
static let headlineFont = Font.system(size: 17, weight: .semibold)
|
||
|
|
static let bodyFont = Font.system(size: 15, weight: .regular)
|
||
|
|
static let captionFont = Font.system(size: 13, weight: .regular)
|
||
|
|
static let smallFont = Font.system(size: 11, weight: .medium)
|
||
|
|
|
||
|
|
static let cardCornerRadius: CGFloat = 12
|
||
|
|
static let cardPadding: CGFloat = 16
|
||
|
|
static let sectionSpacing: CGFloat = 24
|
||
|
|
}
|
||
|
|
|
||
|
|
extension Color {
|
||
|
|
init(hex: String) {
|
||
|
|
var h = hex.trimmingCharacters(in: .init(charactersIn: "#"))
|
||
|
|
if h.count == 3 { h = h.map { "\($0)\($0)" }.joined() }
|
||
|
|
let n = UInt64(h, radix: 16) ?? 0
|
||
|
|
let r = Double((n >> 16) & 0xFF) / 255
|
||
|
|
let g = Double((n >> 8) & 0xFF) / 255
|
||
|
|
let b = Double(n & 0xFF) / 255
|
||
|
|
self.init(red: r, green: g, blue: b)
|
||
|
|
}
|
||
|
|
}
|