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.0Twitter Follow

Simply use it on any String.

publicfunc textColor(_ color:ANSIColor)->String{}publicfunc backgroundColor(_ color:ANSIColor)->String{}publicfunc 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
letpackage=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