Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wzshiming/ctc
Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method
https://github.com/wzshiming/ctc
color colors console go non-invasive unix
Last synced: about 1 month ago
JSON representation
Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method
- Host: GitHub
- URL: https://github.com/wzshiming/ctc
- Owner: wzshiming
- License: mit
- Created: 2018-04-27T18:07:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T04:42:50.000Z (almost 2 years ago)
- Last Synced: 2024-10-22T15:15:14.537Z (about 2 months ago)
- Topics: color, colors, console, go, non-invasive, unix
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 47
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / Advanced Console UIs)
- fucking-awesome-go - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / Advanced Console UIs)
- awesome-go - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / Advanced Console UIs)
- awesome-go - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / Advanced Console UIs)
- awesome-go - ctc - Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method - ★ 4 (Command Line)
- awesome-go-extra - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method|39|3|0|2018-04-27T18:07:42Z|2020-07-15T08:09:32Z| (Build Automation / Advanced Console UIs)
- awesome-go-with-stars - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / Advanced Console UIs)
- awesome-go-cn - ctc
- awesome-go-plus - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. ![stars](https://img.shields.io/badge/stars-46-blue) (Command Line / Advanced Console UIs)
- awesome-go-plus - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. ![stars](https://img.shields.io/badge/stars-46-blue) ![forks](https://img.shields.io/badge/forks-3-blue) (Command Line / Advanced Console UIs)
README
# ctc - Console Text Colors
[![Build Status](https://travis-ci.org/wzshiming/ctc.svg?branch=master)](https://travis-ci.org/wzshiming/ctc)
[![Go Report Card](https://goreportcard.com/badge/github.com/wzshiming/ctc)](https://goreportcard.com/report/github.com/wzshiming/ctc)
[![GoDoc](https://godoc.org/github.com/wzshiming/ctc?status.svg)](https://godoc.org/github.com/wzshiming/ctc)
[![GitHub license](https://img.shields.io/github/license/wzshiming/ctc.svg)](https://github.com/wzshiming/ctc/blob/master/LICENSE)
[![gocover.io](https://gocover.io/_badge/github.com/wzshiming/ctc)](https://gocover.io/github.com/wzshiming/ctc)The non-invasive cross-platform terminal color library does not need to modify the Print method
Virtual unix-like environments on Windows
Cursor related in [github.com/wzshiming/cursor](https://github.com/wzshiming/cursor)
- [English](https://github.com/wzshiming/ctc/blob/master/README.md)
- [简体中文](https://github.com/wzshiming/ctc/blob/master/README_cn.md)## Support style
- [x] console
- [x] unix-like (mac & linux)
- [x] windows## example
``` golang
package mainimport (
"fmt""github.com/wzshiming/ctc"
)func main() {
// No invasion
fmt.Println(ctc.BackgroundRed|ctc.ForegroundBlue, "Hello world", ctc.Reset)
}```
## SGR (Select Graphic Rendition)
| Value | Description | Behavior |
| ------: | :---------------- | :---------------------------------------------------------------- |
| 0 | Default | Returns all attributes to the default state prior to modification |
| 4 | Underline | Adds underline |
| 7 | Negative | Swaps foreground and background colors |
| 30~37 | Foreground | Applies non-bold/bright color to foreground |
| 40~47 | Background | Applies non-bold/bright color to background |
| 90~97 | Bright Foreground | Applies bold/bright color to foreground |
| 100~107 | Bright Background | Applies bold/bright color to background |## License
Pouch is licensed under the MIT License. See [LICENSE](https://github.com/wzshiming/ctc/blob/master/LICENSE) for the full license text.