Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jjotaum/chromacli
Xcode Assets Macros alternative CLI to automatically generate static properties corresponding to color assets on SwiftUI, UIKit or AppKIt projects.
https://github.com/jjotaum/chromacli
assets assets-mobile command-line-tool generator ios macos macros swift swiftui xcode
Last synced: 3 days ago
JSON representation
Xcode Assets Macros alternative CLI to automatically generate static properties corresponding to color assets on SwiftUI, UIKit or AppKIt projects.
- Host: GitHub
- URL: https://github.com/jjotaum/chromacli
- Owner: jjotaum
- License: mit
- Created: 2020-06-08T00:07:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-10T20:55:06.000Z (3 months ago)
- Last Synced: 2024-08-10T21:54:03.254Z (3 months ago)
- Topics: assets, assets-mobile, command-line-tool, generator, ios, macos, macros, swift, swiftui, xcode
- Language: Swift
- Homepage:
- Size: 47.9 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chroma
Xcode Assets Macros alternative CLI to automatically generate static properties corresponding to color assets on SwiftUI, UIKit or AppKIt projects.### Usage
```
$ Chroma --helpUSAGE: chroma --asset --path [--type ] [--framework ]
OPTIONS:
-a, --asset The path of .xcasset file.
-p, --path The path of the generated .swift file.
-t, --type The output type of generated .swift file.
Supported values: extension, struct. (default:
extension)
--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`.