kmshdev/claude-swift-toolkit/swiftui-colors-api
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user asks to "style with colors", "apply gradients", "use foregroundStyle", "add linear/radial gradient", "set tint color", or needs SwiftUI color and ShapeStyle API reference. Provides Color usage, foregroundStyle with hierarchical levels, gradients, system colors, and custom ShapeStyle patterns.
Install
npx vskill@latest install kmshdev/claude-swift-toolkit/swiftui-colors-apiSKILL.md
Colors & ShapeStyle API Reference
Lifecycle Position
Phase 3 API Reference — load during implementation when working with colors, gradients, or tints. Dispatched from autonomous-ui-workflow Phase 2 research table.
Foreground Styling
Hierarchical: .primary, .secondary, .tertiary, .quaternary
System Colors
.black, .blue, .brown, .clear, .cyan, .gray, .green, .indigo, .mint, .orange, .pink, .purple, .red, .teal, .white, .yellow
Tint
Background
Gradients
Color Modifiers
Custom ShapeStyle
When to Use Which
| Need | Use | |
|---|---|---|
| Text, icons that adapt to dark mode | foregroundStyle(.primary), .secondary, .tertiary | |
| Brand colors shared across views | Asset catalog Color("BrandRed") | |
| Tinting interactive elements | .tint(.accentColor) | |
| Multi-color text/icon styling | foregroundStyle(.red, .blue, .green) (primary, secondary, tertiary) | |
| Gradient backgrounds | LinearGradient, RadialGradient, AngularGradient, or .gradient suffix | |
| Platform-bridged colors | Color(nsColor:) for macOS, Color(uiColor:) for iOS | |
| Dynamic color based on scheme | @Environment(\.colorScheme) with conditional |
Common Mistakes
- Using
Color.black/Color.whiteinstead of.primary/semantic colors — breaks in dark mode - Hardcoding hex colors instead of asset catalog — no dark mode variant, no accessibility
- Using
foregroundColor()instead offoregroundStyle()— deprecated API - Applying
.tint()and.foregroundStyle()together — tint overrides foregroundStyle on controls - Missing
.opacity()consideration — semantic colors already have built-in opacity levels
Before (incorrect):
After (correct):
Before (incorrect):
After (correct):
Checklist
- [ ] No hardcoded
Color.black/Color.whitefor text or backgrounds - [ ] Using
foregroundStyle()notforegroundColor() - [ ] Brand colors defined in asset catalog with dark mode variants
- [ ] Gradient direction matches reading direction (leading → trailing)
- [ ] Color contrast meets WCAG AA (4.5:1 for normal text, 3:1 for large text)
Cross-References
swiftui-effects-api— blur, shadow, opacity effects that interact with colorsswiftui-material-api— material backgrounds that adapt to underlying colorsswiftui-ui-patterns— modern API checklist includesforegroundStyle()migration
Security
- Security scanPassed, 98 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/apple-design-system/skills/swiftui-colors-api/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kmshdev/claude-swift-toolkit/swiftui-colors-api)