Documentation
¶
Overview ¶
This package contains some utility functions for printing reusable UI components, such as progress bars and tables.
Index ¶
- Constants
- func BgBlack(s string) string
- func BgBlue(s string) string
- func BgBrightBlack(s string) string
- func BgBrightBlue(s string) string
- func BgBrightCyan(s string) string
- func BgBrightGreen(s string) string
- func BgBrightMagenta(s string) string
- func BgBrightRed(s string) string
- func BgBrightWhite(s string) string
- func BgBrightYellow(s string) string
- func BgCyan(s string) string
- func BgGreen(s string) string
- func BgMagenta(s string) string
- func BgRed(s string) string
- func BgWhite(s string) string
- func BgYellow(s string) string
- func Blink(s string) string
- func Bold(s string) string
- func ClearRect(row1, row2, col1, col2 int)
- func ClearScreen()
- func Dim(s string) string
- func FgBlack(s string) string
- func FgBlue(s string) string
- func FgBrightBlack(s string) string
- func FgBrightBlue(s string) string
- func FgBrightCyan(s string) string
- func FgBrightGreen(s string) string
- func FgBrightMagenta(s string) string
- func FgBrightRed(s string) string
- func FgBrightWhite(s string) string
- func FgBrightYellow(s string) string
- func FgCyan(s string) string
- func FgGreen(s string) string
- func FgMagenta(s string) string
- func FgRed(s string) string
- func FgWhite(s string) string
- func FgYellow(s string) string
- func Hidden(s string) string
- func HideCursor()
- func Italic(s string) string
- func MoveCursorDown(rows int)
- func MoveCursorLeft(cols int)
- func MoveCursorRight(cols int)
- func MoveCursorUp(rows int)
- func Repeat(times int, str string) string
- func Reverse(s string) string
- func SelectPlayers() (edi.VI, edi.VI)
- func SetCursor(row, col int)
- func ShowCursor()
- func Strikethrough(s string) string
- func TerminalSize() (width, height int)
- func Underline(s string) string
Constants ¶
View Source
const ( FG_BLACK = "\u001B[30m" FG_RED = "\u001B[31m" FG_GREEN = "\u001B[32m" FG_YELLOW = "\u001B[33m" FG_BLUE = "\u001B[34m" FG_MAGENTA = "\u001B[35m" FG_CYAN = "\u001B[36m" FG_WHITE = "\u001B[37m" FG_BRIGHT_BLACK = "\u001B[90m" FG_BRIGHT_RED = "\u001B[91m" FG_BRIGHT_GREEN = "\u001B[92m" FG_BRIGHT_YELLOW = "\u001B[93m" FG_BRIGHT_BLUE = "\u001B[94m" FG_BRIGHT_MAGENTA = "\u001B[95m" FG_BRIGHT_CYAN = "\u001B[96m" FG_BRIGHT_WHITE = "\u001B[97m" BG_BLACK = "\u001B[40m" BG_RED = "\u001B[41m" BG_GREEN = "\u001B[42m" BG_YELLOW = "\u001B[43m" BG_BLUE = "\u001B[44m" BG_MAGENTA = "\u001B[45m" BG_CYAN = "\u001B[46m" BG_WHITE = "\u001B[47m" BG_BRIGHT_BLACK = "\u001B[100m" BG_BRIGHT_RED = "\u001B[101m" BG_BRIGHT_GREEN = "\u001B[102m" BG_BRIGHT_YELLOW = "\u001B[103m" BG_BRIGHT_BLUE = "\u001B[104m" BG_BRIGHT_MAGENTA = "\u001B[105m" BG_BRIGHT_CYAN = "\u001B[106m" BG_BRIGHT_WHITE = "\u001B[107m" BOLD = "\u001B[1m" DIM = "\u001B[2m" ITALIC = "\u001B[3m" ITALIC_RESET = "\u001B[23m" UNDERLINE = "\u001B[4m" UNDERLINE_RESET = "\u001b[24m" BLINK = "\u001B[5m" BLINK_RESET = "\u001b[25m" REVERSE = "\u001B[7m" REVERSE_RESET = "\u001b[27m" HIDDEN = "\u001B[8m" HIDDEN_RESET = "\u001b[28m" STRIKETHROUGH = "\u001B[9m" STRIKETHROUGH_RESET = "\u001b[29m" ERASE_SCREEN = "\u001B[2J" RESET_CURSOR = "\u001B[H" MOVE_CURSOR_TO_LINE_START = "\u001B[1G" RESET = "\u001B[0m" RESET_FG = "\u001B[39m" RESET_BG = "\u001b[49m" RESET_INTENSITY = "\u001b[22m" HIDE_CURSOR = "\u001B[?25l" SHOW_CURSOR = "\u001B[?25h" )
View Source
const ( LINE_HORIZONTAL = "\u2500" // ─ LINE_VERTICAL = "\u2502" // │ CORNER_TOP_LEFT = "\u250C" // ┌ CORNER_TOP_RIGHT = "\u2510" // ┐ CORNER_BOTTOM_LEFT = "\u2514" // └ CORNER_BOTTOM_RIGHT = "\u2518" // ┘ T_VERTICAL_RIGHT = "\u251C" // ├ T_VERTICAL_LEFT = "\u2524" // ┤ T_HORIZONTAL_DOWN = "\u252C" // ┬ T_HORIZONTAL_UP = "\u2534" // ┴ CROSS = "\u253C" // ┼ DIAG_UPPER_RIGHT = "\u2571" // ╱ DIAG_LOWER_LEFT = "\u2571" // ╱ DIAG_UPPER_LEFT = "\u2572" // ╲ DIAG_LOWER_RIGHT = "\u2572" // ╲ WHITE_QUEEN = "\u25A0" // ■ BLACK_QUEEN = "\u25A0" // ■ ARROW_SQUARE = "\u2715" // ✕ VACANT_SQUARE = "\u00B7" // · )
Variables ¶
This section is empty.
Functions ¶
func BgBrightBlack ¶
func BgBrightBlue ¶
func BgBrightCyan ¶
func BgBrightGreen ¶
func BgBrightMagenta ¶
func BgBrightRed ¶
func BgBrightWhite ¶
func BgBrightYellow ¶
func ClearRect ¶
func ClearRect(row1, row2, col1, col2 int)
ClearRect clears the rectangular region of the terminal defined by the space between (inclusive) the two row number and the two column numbers
func ClearScreen ¶
func ClearScreen()
func FgBrightBlack ¶
func FgBrightBlue ¶
func FgBrightCyan ¶
func FgBrightGreen ¶
func FgBrightMagenta ¶
func FgBrightRed ¶
func FgBrightWhite ¶
func FgBrightYellow ¶
func HideCursor ¶
func HideCursor()
func MoveCursorDown ¶
func MoveCursorDown(rows int)
func MoveCursorLeft ¶
func MoveCursorLeft(cols int)
func MoveCursorRight ¶
func MoveCursorRight(cols int)
func MoveCursorUp ¶
func MoveCursorUp(rows int)
func SelectPlayers ¶
Prompts the user to select two VIs to play a game and returns them. The first VI should play White and the second should play Black.
func ShowCursor ¶
func ShowCursor()
func Strikethrough ¶
func TerminalSize ¶
func TerminalSize() (width, height int)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.