Documentation
¶
Index ¶
- Constants
- Variables
- func ColorSequence(fn func(a ...any) string) (start, stop string)
- func CursorUpLeftN(lines int) string
- func New256BgColor(code uint8) *color.Color
- func New256FgColor(code uint8) *color.Color
- func NewLineLengthWriter(writer io.Writer, maxLineLength int) io.Writer
- func RunesLength(src []rune, maxLength int) (length, index int)
- func Sequence(terminator byte, attributes ...any) string
Constants ¶
const ( EscapeByte = 0x1b Escape = "\x1b" ClearLine = Escape + "[2K" Reset = Escape + "[0m" )
Variables ¶
var ( Bold = bold.SprintFunc() Cyan = cyan.SprintFunc() Gray = gray.SprintFunc() Green = green.SprintFunc() Yellow = yellow.SprintFunc() Underline = underline.Sprint() )
Functions ¶
func ColorSequence ¶
func CursorUpLeftN ¶
CursorUpLeftN creates the escape sequence to move the cursor left and up N lines
func New256BgColor ¶
New256BgColor return a new xterm 256 (8bit) background color
func New256FgColor ¶
New256FgColor return a new xterm 256 (8bit) foreground color
func NewLineLengthWriter ¶
NewLineLengthWriter return an io.Writer that limits the max line length, adding line breaks ('\n') as needed. The writer detects the right most column (consecutive whitespace) and aligns content if possible. UTF sequences are counted as single character and ANSI escape sequences are not counted at all.
func RunesLength ¶
RunesLength returns the visible content length (and index at the length)
Types ¶
This section is empty.