ansiterm

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ansiterm provides rudimentary support for emitting ANSI terminal escape codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteCodes

func WriteCodes(w io.Writer, codes ...Code) error

Write ANSI terminal codes to w.

Types

type Code

type Code uint8

ANSI terminal escape code. See https://en.wikipedia.org/wiki/ANSI_escape_code

const (
	CodeReset Code = iota
	CodeBold
	CodeFaint
	CodeItalic
	CodeUnderline
	CodeSlowBlink
	CodeRapidBlink
	CodeReverseVideo
	CodeConceal
	CodeCrossedOut
)
const (
	CodeFGBlack Code = iota + 30
	CodeFGRed
	CodeFGGreen
	CodeFGYellow
	CodeFGBlue
	CodeFGMagenta
	CodeFGCyan
	CodeFGWhite
)

Foreground colors.

const (
	CodeBGBlack Code = iota + 40
	CodeBGRed
	CodeBGGreen
	CodeBGYellow
	CodeBGBlue
	CodeBGMagenta
	CodeBGCyan
	CodeBGWhite
)

Background colors.

const (
	CodeFGIBlack Code = iota + 90
	CodeFGIRed
	CodeFGIGreen
	CodeFGIYellow
	CodeFGIBlue
	CodeFGIMagenta
	CodeFGICyan
	CodeFGIWhite
)

Intense foreground colors.

const (
	CodeBGIBlack Code = iota + 100
	CodeBGIRed
	CodeBGIGreen
	CodeBGIYellow
	CodeBGIBlue
	CodeBGIMagenta
	CodeBGICyan
	CodeBGIWhite
)

Intense background colors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL