Pick a color on screen and paste it as SwiftUI
You have a color in a mockup, a competitor's app or a screenshot, and you want it in Xcode. Set SupaPick's default format to SwiftUI Color and every pick lands on your clipboard as Color(red: 0.227, green: 0.482, blue: 0.835), ready to paste. On a wide-gamut display you can copy the Display P3 version instead, with the real P3 values.
macOS 14 or later · Signed and notarized by Apple · Free for 7 days · 14-day refund
How to do it with SupaPick
- Click the eyedropper in the menu bar, open Default Format and choose SwiftUI Color or SwiftUI Color (Display P3). NSColor and UIColor are there too.
- Press ⌃⌥C and click the color. The Swift code is on your clipboard.
- To build a set, go to Recent, open a color and choose Pin to → Favorites or New Palette…. Pinned colors are named after their nearest Tailwind class, and Rename… changes that.
- Open the palette and choose Export → Swift → Copy or Save… for an
extension Colorwith onestatic letper color.
With what's built into macOS
Xcode has its own color tools. You can add a Color Set to an asset catalog and use the Colors window's eyedropper to sample from the screen, which gives you a named color in the catalog rather than code. That is the right home for a design system's colors, and SupaPick doesn't replace it.
For a quick Color(…) in a view or a preview, Digital Color Meter gets you halfway. It shows the values as decimals, percentages or floats, but you copy them out and type the initializer yourself, three numbers at a time.
SupaPick writes the initializer for you with three decimals per channel: Color(red:green:blue:) for sRGB, Color(.displayP3, red:green:blue:) for P3, NSColor(srgbRed:…) for AppKit and UIColor(red:…) for UIKit.
Questions and answers
Is the Display P3 value just the sRGB value relabeled?
What does the Swift export look like?
import SwiftUI line and an extension Color with a static let per color, such as static let sky600 = Color(red: …). Each name comes from that color's name in the palette, made safe for Swift.