Colorize your terminal output with ANSI Colors
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)- Black
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- White
- 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!
Add a dependency to your Package.swift
import PackageDescription
letpackage=Package(
name:"YourPackage",
dependencies:[.Package(url:"git@github.com:somekindofcode/SwiftANSI.git", majorVersion:1)])