Add some color to your terminal.
Inspired by colors.js.
Set foreground color:
print("Red".paint(.Red))Set background color:
print("Red".paint(.OnRed))Apply style:
print("Bold".style(.Bold))Chain colors and styles:
print("Nice".paint(.Green).paint(.OnRed).style(.Bold))
print("Nice".paint(.Green, .OnRed))
print("Nice".paint(.Green, .OnRed, .Bold))Available colors:
.Black.Red.Green.Yellow.Blue.Magenta.Cyan.White.Gray
Available background colors:
.OnBlack.OnRed.OnGreen.OnYellow.OnBlue.OnMagenta.OnCyan.OnWhite.OnGray
Available styles:
.Bold.Dim.Italic.Underline.Inverse.Hidden.Strikethrough
Progress.swift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Colors.swift"To integrate Colors.swift into your Xcode project using Carthage, specify it in your Cartfile:
github "jkandzi/Colors.swift"
Run carthage update to build the framework and drag the built Progress.framework into your Xcode project.
To install with the Swift Package Manager, add the following in your Package.swift:
import PackageDescription
let package = Package(
name: "MyProject",
dependencies: [
.Package(url: "https://github.com/jkandzi/Colors.swift", majorVersion: 0)
]
)You can also copy the Colors.swift file into your Xcode project.
Justus Kandzi, [email protected]
Colors.swift is available under the MIT license. See the LICENSE file for more info.
