ansi

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package ansi defines ANSI control codes for styles and colours.

Index

Constants

View Source
const ClearLine = "\033[2K"

ClearLine is the CSI sequence to clear the entire of the current line.

View Source
const CursorBackwardOne = "\033[1D"

CursorBackwardOne is the CSI sequence to move the cursor backward (to the left for latin fonts) one character.

View Source
const CursorForwardOne = "\033[1C"

CursorForwardOne is the CSI sequence to move the cursor forward (to the right for latin fonts) one character.

View Source
const CursorRestore = "\033[u"

CursorRestore if the CSI sequence to restore the cursor position to a previous store.

View Source
const CursorStore = "\033[s"

CursorStore if the CSI sequence to store the current cursor position.

Variables

View Source
var DimPens map[string]string

DimPens is the table of pastel colors to be used for text.

View Source
var NormalPen string

NormalPen is the CSI sequence for regular text.

View Source
var PenStyles map[string]string

PenStyles is the table of styles to be used for text.

View Source
var Pens map[string]string

Pens is the table of colors to be used for text.

Functions

func ColorBuild

func ColorBuild(pen, paper, attribute string, brightPen, brightPaper bool) (string, error)

ColorBuild creates the ANSI sequence to create the pen with the correct foreground/background color and attribute.

func CursorMove

func CursorMove(n int) string

CursorMove is the CSI sequence to move the cursor n characters forward (positive numbers) or n characters backwards (negative numbers).

Types

This section is empty.

Jump to

Keyboard shortcuts

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