Skip to content
Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method
Branch: master
Clone or download
Latest commit f2a10d0 Oct 22, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples update examples May 25, 2018
.travis.yml Update .travis.yml Oct 22, 2018
LICENSE add LICENSE Jun 6, 2018
README.md update README Jul 18, 2018
README_cn.md update README Jul 18, 2018
ctc.go fixes Jul 10, 2018
ctc_extra.go update extra generate Jun 6, 2018
ctc_extra_gen.go update extra generate Jun 6, 2018
ctc_string.go simplify Jul 10, 2018
ctc_test.go add test Jul 10, 2018

README.md

ctc - Console Text Colors

Build Status Go Report Card GoDoc GitHub license cover.run

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

Virtual unix-like environments on Windows

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)

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 for the full license text.

You can’t perform that action at this time.