CocoaPods trunk is moving to be read-only. Read more on the blog, there are 12 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Jan 2016 |
| SPMSupports SPM | ✓ |
Maintained by Justus Kandzi.
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.GrayAvailable background colors:
.OnBlack.OnRed.OnGreen.OnYellow.OnBlue.OnMagenta.OnCyan.OnWhite.OnGrayAvailable styles:
.Bold.Dim.Italic.Underline.Inverse.Hidden.StrikethroughTo 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.