Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftANSI

Colorize your terminal output with ANSI Colors

Swift 3.0 Twitter Follow

Simply use it on any String.

public func textColor(_ color: ANSIColor) -> String {}
public func backgroundColor(_ color: ANSIColor) -> String {}
public func style(_ style: ANSIStyle) -> String {}

Example:

"This " +
"line ".textColor(.Yellow) +
"is " +
"mixed".backgroundColor(.Blue)

chaining possible

"Lorem Ipsum".style(.Bold)
  .textColor(.Red)
  .backgroundColor(.White)

Colors

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

Styles

  • Bold
  • Italic
  • Underline
  • Inverse
  • Blink
  • Strikethrough

You can take a look at the Sources/main.swift to. This file is no included in the compiled package!

Install

Add a dependency to your Package.swift

import PackageDescription

let package = Package(
    name: "YourPackage",
    dependencies: [
        .Package(url: "git@github.com:somekindofcode/SwiftANSI.git", majorVersion: 1)
    ]
)

About

Colorize your terminal output with ANSI Colors

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages