Files
TUIkit/Sources/TUIkitExample/Pages/ColorsPage.swift
T
phranck 95029184e7 Chore: Rename TUIKit to TUIkit
- Rename module, targets and products in Package.swift
- Rename directories: Sources/TUIkit, TUIkitExample, Tests/TUIkitTests
- Rename files: TUIkit.swift, TUIkit.docc/TUIkit.md
- Update all import statements, module-qualified calls, file headers
- Update doc comments, string literals and DocC articles
- Update CI workflow, README, .swiftlint.yml and markdown docs
- Merge platform badges into single combined badge in README
- Add "Example App auslagern" task to to-dos.md
2026-01-30 20:29:29 +01:00

68 lines
2.3 KiB
Swift

//
// ColorsPage.swift
// TUIkitExample
//
// Demonstrates color capabilities.
//
import TUIkit
/// Colors demo page.
///
/// Shows various color options including:
/// - Standard ANSI colors (8 colors)
/// - Bright colors (8 colors)
/// - RGB colors (24-bit true color)
/// - Semantic colors (primary, success, warning, error)
struct ColorsPage: View {
var body: some View {
VStack(spacing: 1) {
HeaderView(title: "Colors Demo")
DemoSection("Standard ANSI Colors") {
HStack(spacing: 2) {
Text("Black").foregroundColor(.black).background(.white)
Text("Red").foregroundColor(.red)
Text("Green").foregroundColor(.green)
Text("Yellow").foregroundColor(.yellow)
}
HStack(spacing: 2) {
Text("Blue").foregroundColor(.blue)
Text("Magenta").foregroundColor(.magenta)
Text("Cyan").foregroundColor(.cyan)
Text("White").foregroundColor(.white)
}
}
DemoSection("Bright Colors") {
HStack(spacing: 2) {
Text("Bright Red").foregroundColor(.brightRed)
Text("Bright Green").foregroundColor(.brightGreen)
Text("Bright Yellow").foregroundColor(.brightYellow)
Text("Bright Blue").foregroundColor(.brightBlue)
}
}
DemoSection("RGB Colors (24-bit)") {
HStack(spacing: 2) {
Text("Orange").foregroundColor(.rgb(255, 128, 0))
Text("Pink").foregroundColor(.rgb(255, 105, 180))
Text("Teal").foregroundColor(.rgb(0, 128, 128))
Text("Purple").foregroundColor(.rgb(128, 0, 128))
}
}
DemoSection("Semantic Colors") {
HStack(spacing: 2) {
Text("Primary").foregroundColor(.primary)
Text("Success").foregroundColor(.success)
Text("Warning").foregroundColor(.warning)
Text("Error").foregroundColor(.error)
}
}
Spacer()
}
}
}