Skip to content

Repository files navigation

woad.Go

Minimal ANSI terminal colour codes, for Go

Language License GitHub release Last Commit Go Go Reference

Table of Contents

Introduction

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.

Installation & Usage

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"

Components

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() string

Examples

Examples are provided in the examples directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/woad.Go.

Dependencies

Development/Example/Testing Dependencies

Related projects

License

woad.Go is released under the 3-clause BSD license. See LICENSE for details.

About

Rock-bottom colour library, for Go

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages