Awesome Go

ctc

CategoryCommand Line
SubcategoryAdvanced Console UIs
Stars0

The non-invasive cross-platform terminal color library does not need to modify the Print method

About ctc

ctc - Console Text Colors

Build Status Go Report Card GoDoc GitHub license gocover.io

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

Support style

  • console
    • unix-like (mac & linux)
    • windows

example

package main

import (
	"fmt"

	"github.com/wzshiming/ctc"
)

func main() {
	// No invasion
	fmt.Println(ctc.BackgroundRed|ctc.ForegroundBlue, "Hello world", ctc.Reset)
}

SGR (Select Graphic Rendition)

ValueDescriptionBehavior
0DefaultReturns all attributes to the default state prior to modification
4UnderlineAdds underline
7NegativeSwaps foreground and background colors
30~37ForegroundApplies non-bold/bright color to foreground
40~47BackgroundApplies non-bold/bright color to background
90~97Bright ForegroundApplies bold/bright color to foreground
100~107Bright BackgroundApplies bold/bright color to background

License

Pouch is licensed under the MIT License. See LICENSE for the full license text.

Frequently Asked Questions

What is ctc?

ctc is a Command Line library for the Go programming language. The non-invasive cross-platform terminal color library does not need to modify the Print method

How do I install ctc?

Install ctc with the Go module system using `go get wzshiming/ctc`. Check the repository for the current installation instructions.

What category does ctc belong to?

ctc is listed under Command Line, specifically Advanced Console UIs.

← Back to Advanced Console UIs