Convert Hex to SwiftUI & UIKit Color

Convert #Hex or Display P3 codes into clean SwiftUI Color, Apple UIColor, and static extension snippets ready for Xcode.

0 bytes sent
  • 100% browser-local
  • Zero server transfers
  • CSS Color 4 precision

or drop a color string, CSS/JSON snippet, or file here · Ctrl V to paste · Paste Hex, RGB, HSL, OKLCH or use Screen Eyedropper

Instant Before & After Specimen

SwiftUI Color + UIKit UIColor (P3 & sRGB)
Input Samplebrand.hex
#2563EB
Expected OutputDisplay P3
// SwiftUI Display P3
Color(.displayP3, red: 0.2151, green: 0.3822, blue: 0.8921, opacity: 1.0)
// UIKit
UIColor(displayP3Red: 0.2151, green: 0.3822, blue: 0.8921, alpha: 1.0)

HEX vs Display P3

Source vs. target format specification comparison
PropertySource: HEXTarget: Display P3
Gamut scopesRGB (Standard Web)Wide Gamut (P3 / Unbounded)
Perceptual uniformityNoNo
Alpha channel supportYesYes
Human readabilityMediumMedium
Extension / Token.css / .txt.css / .icc
Best forCompact copy-paste handoff in sRGB brand guidelines and legacy CSSVivid OLED/Retina web hero accents, Apple devices, and HDR/wide-gamut UI badges

How to use Hex to SwiftUI & UIKit

Hex to SwiftUI & UIKit — cleanly inside your local browser with zero server transfers.

  1. Enter or pick a colorType Hex, RGB, HSL, OKLCH, or Lab — or click Screen Eyedropper and live sliders.
  2. Inspect math & gamutReview exact CSS Color 4 readouts, sRGB vs Display P3 status, and profile options.
  3. Copy, chain, or exportCopy ready CSS/JSON snippets, download binary swatch files, or pipe directly to related Colr tools.

Frequently asked questions

Does it support SwiftUI Display P3 Color(.displayP3, ...)?

Yes — switch between sRGB and .displayP3 color spaces in options for native Retina P3 assets.

Does it include alpha opacity when given #RRGGBBAA?

Yes — 8-digit hex inputs add opacity: automatically.