Hex to SwiftUI & UIColor Converter
Turn a hex color into SwiftUI, UIKit and asset catalog code.
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.
Popular uses
- hex to swiftui
- uicolor
- swift color
- xcode color set
- ios
- swiftui
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
Build palettes and export a full light + dark theme as CSS variables or Tailwind tokens.
Works well with
Next steps from other categories.
Apple App Site Association Generator
Generators
Build the AASA file that powers iOS universal links.
iOS .strings ↔ JSON Converter
Converters
Convert Localizable.strings files to JSON and back.
iOS Device Screen Sizes Reference
Dev Utilities
Points, pixels, scale factors and App Store screenshot sizes for iPhone, iPad and Apple Watch.
iOS Privacy Manifest Generator
Generators
Build Apple's PrivacyInfo.xcprivacy file for App Store submission.
Frequently asked questions
Version 1.0.0 · Updated 2026-08-23 · Runs entirely in your browser