Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdhealy/PrettyColors
Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48.
https://github.com/jdhealy/PrettyColors
Last synced: 3 months ago
JSON representation
Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48.
- Host: GitHub
- URL: https://github.com/jdhealy/PrettyColors
- Owner: jdhealy
- License: mit
- Created: 2015-01-09T22:34:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-08-12T22:46:05.000Z (about 4 years ago)
- Last Synced: 2024-08-02T18:34:56.322Z (3 months ago)
- Language: Swift
- Size: 148 KB
- Stars: 171
- Watchers: 6
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-swift - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Libs / Colors)
- awesome-swift - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Libs / Colors)
- fucking-awesome-swift - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Libs / Colors)
- awesome-ios-star - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Color / Linter)
- awesome-swift-cn - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Libs / Colors)
- awesome-ios - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Color / Linter)
- fucking-awesome-ios - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Color / Linter)
- fucking-awesome-ios - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. (Color / Linter)
- awesome-swift - PrettyColors - Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. ` 📝 2 years ago ` (Colors [🔝](#readme))
README
# PrettyColors
[![Carthage Compatibility](https://img.shields.io/badge/Carthage-✔-f2a77e.svg?style=flat)][carthage]
[![Swift Package Manager Compatibility](https://img.shields.io/badge/Swift%20Package%20Manager-✔-f2a77e.svg?style=flat)](./Package.swift)
[![CocoaPods Version](https://img.shields.io/cocoapods/v/PrettyColors.svg?style=flat)][CocoaPods]
[![License](https://img.shields.io/cocoapods/l/PrettyColors.svg?style=flat)](./LICENSE.md)
[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20linux-lightgrey.svg)][deployment_targets][carthage]: https://github.com/Carthage/Carthage/
[CocoaPods]: https://cocoapods.org/pods/PrettyColors/
[deployment_targets]: https://github.com/jdhealy/PrettyColors/blob/40dba7f/PrettyColors.podspec#L14-L17## Description
`PrettyColors` is a Swift library for styling and coloring text in the Terminal.
The library outputs [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) and conforms to [ECMA Standard 48](http://www.ecma-international.org/publications/standards/Ecma-048.htm).### Example
```swift
import PrettyColorslet redText: String = Color.Wrap(foreground: .red).wrap("A red piece of text.")
println(redText)Color.Wrap(foreground: .yellow, style: .bold)
Color.Wrap(foreground: .green, background: .black, style: .bold, .underlined)// 8-bit (256) color support
Color.Wrap(foreground: 114)
Color.Wrap(foreground: 114, style: .bold)
```**More examples can be found in [the tests](./Tests/UnitTests/PrettyColorsTests.swift).**
### Installation
#### [Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application)
Add the following to your Cartfile:```ogdl
github "jdhealy/PrettyColors"
```
#### [CocoaPods](https://cocoapods.org)
Add the following to your [Podfile](https://guides.cocoapods.org/using/the-podfile.html):```ruby
pod 'PrettyColors', :git => 'https://github.com/jdhealy/PrettyColors'
```You will also need to make sure you're opting into using frameworks:
```ruby
use_frameworks!
```Then run `pod install` with CocoaPods 0.36 or newer.
## Inspiration
- [`junegunn/ansi256`](https://github.com/junegunn/ansi256/)
- [`tehmaze/ansi`](https://github.com/tehmaze/ansi/)## License
PrettyColors is released under the [MIT license](https://opensource.org/licenses/MIT). See [LICENSE.md](./LICENSE.md) for details.