Minimal ANSI terminal colour codes, for Go
woad provides the smallest useful set of fixed ANSI SGR colour sequences for library authors. It is not a console or TUI framework.
woad.Go is the Go implementation.
Install via go get, as in:
go get "github.com/synesissoftware/woad.Go"and then import as:
import woad "github.com/synesissoftware/woad.Go"or, simply, as:
import "github.com/synesissoftware/woad.Go"woad.Go ships SGR string constants (RESET, FG_*, BG_*, including bright variants) and a version API (Version(), VersionString()). The sequences are always emitted; they do not inspect TTY state or Windows console mode. TTY/stream gating and Windows virtual-terminal opt-in are not implemented yet.
fmt.Println(woad.FG_GREEN + "ok" + woad.RESET)const (
VersionMajor uint16 = /* ... */
VersionMinor uint16 = /* ... */
VersionPatch uint16 = /* ... */
VersionAB uint16 = /* ... */
)
func Version() uint64
func VersionString() stringExamples are provided in the examples directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/woad.Go.
woad.Go is released under the 3-clause BSD license. See LICENSE for details.