Skip to content

A Swift package that helps adding colors to strings written to the terminal.

License

Notifications You must be signed in to change notification settings

getGuaka/Colorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Swift package that helps adding colors to strings written to the terminal.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages