Latest 0.1.1
Homepage https://github.com/jkandzi/Colors.swift
License MIT
Platforms osx 10.9, requires ARC
Authors

Build Status
Carthage compatible
SPM ready
Version
License
Platform

screenshot

Add some color to your terminal.

Inspired by colors.js.

Usage

Set foreground color:

print("Red".paint(.Red))

Set background color:

print("Red".paint(.OnRed))

Apply style:

print("Bold".style(.Bold))

Chain colors and styles:

print("Nice".paint(.Green).paint(.OnRed).style(.Bold))

print("Nice".paint(.Green, .OnRed))
print("Nice".paint(.Green, .OnRed, .Bold))

Available colors:

  • .Black
  • .Red
  • .Green
  • .Yellow
  • .Blue
  • .Magenta
  • .Cyan
  • .White
  • .Gray

Available background colors:

  • .OnBlack
  • .OnRed
  • .OnGreen
  • .OnYellow
  • .OnBlue
  • .OnMagenta
  • .OnCyan
  • .OnWhite
  • .OnGray

Available styles:

  • .Bold
  • .Dim
  • .Italic
  • .Underline
  • .Inverse
  • .Hidden
  • .Strikethrough

Installation

CocoaPods

Progress.swift is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Colors.swift"

Carthage

To integrate Colors.swift into your Xcode project using Carthage, specify it in your Cartfile:

github "jkandzi/Colors.swift"

Run carthage update to build the framework and drag the built Progress.framework into your Xcode project.

Swift Package Manager

To install with the Swift Package Manager, add the following in your Package.swift:

import PackageDescription

let package = Package(
    name: "MyProject",
    dependencies: [
        .Package(url: "https://github.com/jkandzi/Colors.swift", majorVersion: 0)
    ]
)

Manual

You can also copy the Colors.swift file into your Xcode project.

Author

Justus Kandzi, [email protected]

License

Colors.swift is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Colors.swift",
    "version": "0.1.1",
    "license": "MIT",
    "summary": "Add colors to your swift command line tools.",
    "description": "Add colors to your swift command line tools. Specify background color, foreground color and styles on your terminal outputs.",
    "platforms": {
        "osx": "10.9"
    },
    "homepage": "https://github.com/jkandzi/Colors.swift",
    "social_media_url": "http://twitter.com/justuskandzi",
    "authors": {
        "Justus Kandzi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jkandzi/Colors.swift.git",
        "tag": "0.1.1"
    },
    "source_files": "Sources/*.swift",
    "requires_arc": true,
    "module_name": "Progress"
}

Pin It on Pinterest

Share This