Hex to SwiftUI & UIColor Converter
Turn a hex color into SwiftUI, UIKit and asset catalog code.
SwiftUI Color
UIKit UIColor
Xcode asset catalog — Contents.json
About the Hex to SwiftUI & UIColor Converter
Paste any hex color (3, 6 or 8 digits) and get ready-to-paste Swift code: a SwiftUI Color extension, a UIKit UIColor extension and the Contents.json body for an Xcode asset catalog color set. Alpha is preserved and a live swatch shows exactly what you will ship.
Examples
Brand red
#e04a32Output
Color(red: 0.878, green: 0.290, blue: 0.196)Keyboard shortcuts
- Copy the main outputCtrl / ⌘ + Shift + C
- Download the resultCtrl / ⌘ + S
- Share this toolCtrl / ⌘ + Shift + S
- Reset the inputsAlt + R
- Open the tool search paletteCtrl / ⌘ + K
Related tools
Color Blindness Simulator
Color
Simulate how a palette looks with common color vision deficiencies.
Color Converter
Color
Convert colors between HEX, RGB, HSL, HWB, OKLCH and CMYK.
Color Mixer
Color
Blend two colors with a ratio slider and preview CSS blend modes.
Contrast Checker
Color
Check WCAG 2.1 contrast ratio between two colors.
Gradient Palette Extractor
Color
Extract and normalize colors from CSS gradients or lists.
Palette Generator
Color
Generate complementary, analogous, triadic and other palettes.
Frequently asked questions
Version 1.0.0 · Updated 2026-08-23 · Runs entirely in your browser