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: 24 days 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T04:42:50.000Z (about 1 year ago)
- Last Synced: 2024-01-30T04:04:45.675Z (4 months ago)
- Topics: color, colors, console, go, non-invasive, unix
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 46
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- 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-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 - 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-projects - 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 - invasive cross-platform terminal color library does not need to modify the Print method. | - | - | - | (Command Line / Advanced Console UIs)
- awesome-go-with-framework - 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)
- go-awesome-cn-star - ctc
- awesome-go-cn - ctc
- 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-stars - ctc(stars: 46) - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / 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-Char - 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)
- repo-1316-awesome-go-cn - ctc
- repo-1211-awesome-go-cn - ctc
- awesome-reader - ctc - The non-invasive cross-platform terminal color library does not need to modify the Print method. (Command Line / Advanced Console UIs)
- Go-awesome - 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-handwritten - 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 - The non-invasive cross-platform terminal color library does not need to modify the Print method. - :arrow_down:0 - :star:4 (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-zh - ctc
- awesome-go-cn - ctc
- 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 - 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-cn - ctc
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.