Turn an NSColor or UIColor into an image with swift

Swift Color Swatches

A simple Swift package - all it does is draw rectangles of solid colors as NSImages and UIImages.

You can simply use .swatch on a native image:

import AppKit
import ColorSwatches

NSImage.swatch(color: .systemPurple)

Or .swatch on a native color:

import UIKit
import ColorSwatches

UIColor.systemPurple.swatch()

GitHub

https://github.com/RougeWare/Swift-Color-Swatches