Files
suixinkan_ios_new/suixinkan/Core/Design/AppDesign.swift
2026-06-22 15:35:12 +08:00

46 lines
1.4 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// AppDesign.swift
// suixinkan
//
// Created by Codex on 2026/6/18.
//
import SwiftUI
///
enum AppDesign {
static let primary = Color(hex: 0x0073FF)
static let primarySoft = Color(hex: 0xEFF6FF)
static let textPrimary = Color(hex: 0x1F2937)
static let textSecondary = Color(hex: 0x6B7280)
static let placeholder = Color(hex: 0xA8B2C1)
static let success = Color(hex: 0x14964A)
static let warning = Color(hex: 0xFF7B00)
}
extension Color {
/// 0xRRGGBB SwiftUI Color
init(hex: UInt, alpha: Double = 1.0) {
self.init(
.sRGB,
red: Double((hex >> 16) & 0xff) / 255.0,
green: Double((hex >> 8) & 0xff) / 255.0,
blue: Double(hex & 0xff) / 255.0,
opacity: alpha
)
}
}
extension View {
///
func appInputFieldStyle(cornerRadius: CGFloat, minHeight: CGFloat) -> some View {
padding(.horizontal, AppMetrics.Spacing.medium)
.frame(minHeight: minHeight)
.background(Color(hex: 0xF8FAFC), in: RoundedRectangle(cornerRadius: cornerRadius))
.overlay {
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color(hex: 0xE2E8F0), lineWidth: 1)
}
}
}