SwiftUIColor

Make system color defined in UIColor/NSColor available to SwiftUI Color.

About

In this library, colors are defined in an asset file. image

Create an extension file for SwiftUI.Color using the Swift Package Plugin. Files are generated by prebuildCommand.

image

Usage

  1. import
    import SwiftUIColor
  2. Use

    // iOS system colors
    Color.iOS.systemBackground
    
    // macOS system colors
    Color.macOS.secondarySystemFillColor

GitHub

View Github