Documentation
¶
Index ¶
- Constants
- func Bg256(color uint8) string
- func BgRgb(red, green, blue uint8) string
- func CursorCol(col int) string
- func CursorDownN(line int) string
- func CursorLeftN(col int) string
- func CursorMove(x, y int) string
- func CursorRightN(col int) string
- func CursorUpN(line int) string
- func Fg256(color uint8) string
- func FgRgb(red, green, blue uint8) string
Constants ¶
View Source
const ( Reset = ESC + "[0m" Bold = ESC + "[1m" Faint = ESC + "[2m" Italic = ESC + "[3m" Underline = ESC + "[4m" Blink = ESC + "[5m" Reverse = ESC + "[7m" CrossedOut = ESC + "[9m" )
Ex: fmt.Println(ansi.Underline + "Underlined text")
View Source
const ( Black = ESC + "[30m" Red = ESC + "[31m" Green = ESC + "[32m" Yellow = ESC + "[33m" Blue = ESC + "[34m" Magenta = ESC + "[35m" Cyan = ESC + "[36m" White = ESC + "[37m" BrightBlack = ESC + "[90m" BrightRed = ESC + "[91m" BrightGreen = ESC + "[92m" BrightYellow = ESC + "[93m" BrightBlue = ESC + "[94m" BrightMagenta = ESC + "[95m" BrightCyan = ESC + "[96m" BrightWhite = ESC + "[97m" )
Ex: fmt.Println(ansi.Blue + "Blue text")
View Source
const ( BgBlack = ESC + "[40m" BgRed = ESC + "[41m" BgGreen = ESC + "[42m" BgYellow = ESC + "[43m" BgBlue = ESC + "[44m" BgMagenta = ESC + "[45m" BgCyan = ESC + "[46m" BgWhite = ESC + "[47m" BgBrightBlack = ESC + "[100m" BgBrightRed = ESC + "[101m" BgBrightGreen = ESC + "[102m" BgBrightYellow = ESC + "[103m" BgBrightBlue = ESC + "[104m" BgBrightMagenta = ESC + "[105m" BgBrightCyan = ESC + "[106m" BgBrightWhite = ESC + "[107m" )
Ex: fmt.Println(ansi.BgBlue + "Text with a blue background")
View Source
const ( CursorHome = ESC + "[H" CursorSave = ESC + "[s" CursorRestore = ESC + "[u" CursorVisible = ESC + "[?25h" CursorInvisible = ESC + "[?25l" )
View Source
const ( AlternativeBufferEnable = ESC + "[?1049h" AlternativeBufferDisable = ESC + "[?1049l" )
View Source
const ( ScreenSave = ESC + "[?47h" ScreenRestore = ESC + "[?47l" ScreenClear = ESC + "[2J" ScreenClearUp = ESC + "[1J" ScreenClearDown = ESC + "[0J" ScreenClearEnd = ESC + "[J" )
View Source
const ( LineClear = ESC + "[2K" LineClearStart = ESC + "[1K" LineClearEnd = ESC + "[K" )
View Source
const ESC = "\033"
Escape code
Variables ¶
This section is empty.
Functions ¶
func BgRgb ¶
RGB Background Color Ex: fmt.Println(ansi.BgRgb(30, 30, 255) + "Text with a blue background")
func CursorDownN ¶
Move cursor {line} down Ex: fmt.Print(ansi.CursorDown(10))
func CursorLeftN ¶
Move cursor {col} left Ex: fmt.Print(ansi.CursorLeft(10))
func CursorMove ¶
Move cursor to {col}, {line} Ex: fmt.Print(ansi.CursorMove(10,20))
func CursorRightN ¶
Move cursor {col} right Ex: fmt.Print(ansi.CursorRight(10))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.
