Documentation
¶
Index ¶
- Constants
- Variables
- func CharArea(ch rune, p1x, p1y, p2x, p2y int) (string, error)
- func ClearEntireLine() string
- func ClearEntireScreen() string
- func ClearHome() string
- func ClearLineLeft() string
- func ClearLineRight() string
- func ClearScreenDown() string
- func ClearScreenUp() string
- func Color256Bg(c int) string
- func Color256Fg(c int) string
- func ColorRGBBg(r, g, b int) string
- func ColorRGBFg(r, g, b int) string
- func CursorDown(n int) string
- func CursorHide() string
- func CursorHome() string
- func CursorLeft(n int) string
- func CursorNextLine() string
- func CursorPos() (int, int, error)
- func CursorRight(n int) string
- func CursorShow() string
- func CursorTo(x, y int) string
- func CursorUp(n int) string
- func DrawTable(tbl [][]string, sym Borders) ([]string, error)
- func FrameArea(sym Borders, p1x, p1y, p2x, p2y int) (string, error)
- func GetChar() (rune, error)
- func ReserveArea(n int) string
- func Restore(s State) (err error)
- func RestoreAttrs() string
- func RevPrint(v string) string
- func SaveAttrs() string
- func SetGRA(gras ...string) string
- func Size() (x, y int, err error)
- type Borders
- type State
Constants ¶
View Source
const ( // styles Reset = Esc + "[1;0m" Bold = Esc + "[1;1m" Faint = Esc + "[1;2m" Italic = Esc + "[1;3m" Underlined = Esc + "[1;4m" BlinkSlow = Esc + "[1;5m" BlinkRapid = Esc + "[1;6m" Reverse = Esc + "[1;7m" Invisible = Esc + "[1;8m" Strike = Esc + "[1;9m" Overline = Esc + "[1;53m" // foreground colors FgDefault = Esc + "[1;39m" FgBlack = Esc + "[1;30m" FgRed = Esc + "[1;31m" FgGreen = Esc + "[1;32m" FgYellow = Esc + "[1;33m" FgBlue = Esc + "[1;34m" FgMagenta = Esc + "[1;35m" FgCyan = Esc + "[1;36m" FgLightGray = Esc + "[1;37m" FgDarkGray = Esc + "[1;90m" FgLightRed = Esc + "[1;91m" FgLightGreen = Esc + "[1;92m" FgLightYellow = Esc + "[1;93m" FgLightBlue = Esc + "[1;94m" FgLightMagenta = Esc + "[1;95m" FgLightCyan = Esc + "[1;96m" FgWhite = Esc + "[1;97m" // background colors BgDefault = Esc + "[1;49m" BgBlack = Esc + "[1;40m" BgRed = Esc + "[1;41m" BgGreen = Esc + "[1;42m" BgYellow = Esc + "[1;43m" BgBlue = Esc + "[1;44m" BgMagenta = Esc + "[1;45m" BgCyan = Esc + "[1;46m" BgLightGray = Esc + "[1;47m" BgDarkGray = Esc + "[1;100m" BgLightRed = Esc + "[1;101m" BgLightGreen = Esc + "[1;102m" BgLightYellow = Esc + "[1;103m" BgLightBlue = Esc + "[1;104m" BgLightMagenta = Esc + "[1;105m" BgLightCyan = Esc + "[1;106m" BgWhite = Esc + "[1;107m" )
View Source
const Esc = "\x1b"
escape
Variables ¶
View Source
var ( ErrPositionsEqual = errors.New("the positions of the points are equal") ErrNegative = errors.New("value is negative") ErrLWOfAreaUnderTwo = errors.New("the length and width of the area must be at least 2") ErrTblLineShorterThanTbl = errors.New("the table line is shorter than the table") )
View Source
var ( RoundedBorders = Borders{'│', '─', '╭', '╮', '╰', '╯', '├', '┤', '┬', '┴', '┼'} SharpBorders = Borders{'│', '─', '┌', '┐', '└', '┘', '├', '┤', '┬', '┴', '┼'} DoubleBorders = Borders{'║', '═', '╔', '╗', '╚', '╝', '╠', '╣', '╦', '╩', '╬'} AsciiBorders = Borders{'|', '-', '+', '+', '+', '+', '+', '+', '+', '+', '+'} DotBorders = Borders{'.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'} )
chars for borders
Functions ¶
func ClearEntireLine ¶
func ClearEntireLine() string
func ClearEntireScreen ¶
func ClearEntireScreen() string
func ClearLineLeft ¶
func ClearLineLeft() string
func ClearLineRight ¶
func ClearLineRight() string
func ClearScreenDown ¶
func ClearScreenDown() string
func ClearScreenUp ¶
func ClearScreenUp() string
func Color256Bg ¶
func Color256Fg ¶
func ColorRGBBg ¶
func ColorRGBFg ¶
func CursorDown ¶
func CursorHide ¶
func CursorHide() string
func CursorHome ¶
func CursorHome() string
func CursorLeft ¶
func CursorNextLine ¶
func CursorNextLine() string
func CursorPos ¶
get cursor position WARNING: has the side affect if program already wait for input from stdin info about cursor position can by broken or incorrect
func CursorRight ¶
func CursorShow ¶
func CursorShow() string
func ReserveArea ¶
func RestoreAttrs ¶
func RestoreAttrs() string
Types ¶
Click to show internal directories.
Click to hide internal directories.