Swiftpack.co - getGuaka/Colorizer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by getGuaka.
getGuaka/Colorizer 0.2.1
A Swift package that helps adding colors to strings written to the terminal.
⭐️ 6
🕓 4 years ago
.package(url: "https://github.com/getGuaka/Colorizer.git", from: "0.2.1")

Colorizer 🎨 Build Status

Colorizer helps adding colors to strings written to the terminal.

Usage

Colorizer helps styling the strings before printing them to the terminal. You can change the text color, the text background and the text style. Colorizer works by extending String struct to add styling to it.

To change the text color, use either string.f or string.foreground:

print("Red String".f.Red)
print("Blue String".foreground.Blue)

To change the text background color, use either string.b or string.background:

print("I have a white background".b.White)
print("My background color is green".background.Green)

To change the text background style, use either string.s or string.style:

print("I am a bold string".s.Bold)
print("I have an underline".style.Underline)

You can compose foreground, background, and style:

print("I am an underlined red on white string".s.Underline.f.Red.b.White)

Installation

Swift Package Manager

.package(url: "https://github.com/getGuaka/Colorizer.git", from: "0.0.0"),

License

MIT

GitHub

link
Stars: 6
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics