Skip to content

dduan/Dye

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Dye

Dye is a Swift library for adding styles and colors to command-line outputs.

It works in terminal simulator that supports ANSI (most on macOS and Linux), as well as older apps on Windows, such as CMD.exe.

Usage

SwiftPM/Xcode

Dye is a SwiftPM package. Add it as a dependency in Package.swift:

.package(url: "http://github.com/dduan/Dye", from: "0.0.1")

… or the URL in Xcode.

CMake

Dye also builds with CMake. It works on Windows 10 and Swift 5.2.

Documentation

The file Examples/main.swift is a sample application that demonstrates most of Dye's APIs. To get a taste of how Dye works, try it out with swift run example, and take a look at its source code.

This is what the example CLI app looks like in Command Prompt on Windows:

Dye example app running in Window Command Prompt

Read the docstring in the source code for detailed API documentation.

Dye follows the NO_COLOR convention.

License

MIT. See LICENSE.md

Alternative

If you don't need Windows Support, I recommend you check out Chalk.

About

Cross-platform terminal styling for Swift command-line interface.

Resources

License

Stars

Watchers

Forks

Packages

No packages published