Swiftpack.co - jjotaum/Chroma as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jjotaum.
jjotaum/Chroma 0.6.0
A command line tool to generate .swift extensions or structs files from .xcassets on your UIKit, AppKIt or SwiftUI projects.
⭐️ 5
🕓 11 weeks ago
macOS
.package(url: "https://github.com/jjotaum/Chroma.git", from: "0.6.0")

Chroma

A command line tool to generate .swift extensions or structs files from .xcassets on your UIKit, AppKIt or SwiftUI projects.

Usage

$ Chroma --help

USAGE: chroma --asset <asset> --path <path> [--type <type>] [--framework <framework>]

OPTIONS:
  -a, --asset <asset>     The path of .xcasset file.
  -p, --path <path>       The path of the generated .swift file.
  -t, --type <type>       The output type of generated .swift file.
                          Supported values: extension, struct. (default:
                          extension)
  --framework <framework> The framework compatibility of generated .swift file.
                          Supported values: AppKit, SwiftUI, UIKit. (default:
                          SwiftUI)
  -h, --help              Show help information.

Installation

Clone Chroma on your machine:

$ git clone https://github.com/jjotaum/Chroma.git

Navigate to it's directory:

$ cd Chroma

Execute install script

$ ./install.sh

Chroma should now be installed on /usr/local/bin and can be accessed via terminal.

$ chroma

Integrate Chroma on your Xcode Project

You can easily integrate Chroma on your Xcode project to maintain your generated files updated.

Select your project target on Xcode > go to Build Phases tab > Press on + > Select New Run Script Phase > Uncheck Based on dependency analysis option.

Copy & paste below command on your new script phase and update paths & platform parameters according to your needs.

chroma --asset MyProject/Assets.xcassets --path MyProject/Extensions/Colors.swift --framework SwiftUI

Optionally you can rename your new Run Script to Chroma.

GitHub

link
Stars: 5
Last commit: 11 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.6.0
11 weeks ago

What's Changed

  • Refactor Platform type to Framework which is more aligned with the concept of what we are representing.
  • Default Framework is now SwiftUI, Update README file.
  • Move all file generation logic to new FileGenerator class.
  • Add unit test for header method.
  • header method update to validate struct file name is Capitalized.
  • Update help info for some parameters.

Full Changelog: https://github.com/jjotaum/Chroma/compare/0.5.1...0.6.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics