islazy: Index | Files

package tui

import ""

Package tui contains a set of helper objects and functions for terminal based user interfaces.


Package Files

colors.go doc.go table.go


var (
    // effects
    BOLD  = "\033[1m"
    DIM   = "\033[2m"
    RESET = "\033[0m"
    // colors
    RED    = "\033[31m"
    GREEN  = "\033[32m"
    BLUE   = "\033[34m"
    YELLOW = "\033[33m"
    // foreground colors
    FOREBLACK = "\033[30m"
    FOREWHITE = "\033[97m"
    // background colors
    BACKDARKGRAY  = "\033[100m"
    BACKRED       = "\033[41m"
    BACKGREEN     = "\033[42m"
    BACKYELLOW    = "\033[43m"
    BACKLIGHTBLUE = "\033[104m"

func Blue Uses

func Blue(s string) string

Blue makes the string Green.

func Bold Uses

func Bold(s string) string

Bold makes the string Bold.

func Dim Uses

func Dim(s string) string

Dim makes the string Diminished.

func Disable Uses

func Disable()

Disable will disable all colors and effects.

func Effects Uses

func Effects() bool

Effects returns true if colors and effects are supported on the current terminal.

func Green Uses

func Green(s string) string

Green makes the string Green.

func HasEffect Uses

func HasEffect(s string) bool

HasEffect returns true if the string has any shell control codes in it.

func Red Uses

func Red(s string) string

Red makes the string Red.

func Table Uses

func Table(w io.Writer, columns []string, rows [][]string)

Table accepts a slice of column labels and a 2d slice of rows and prints on the writer an ASCII based datagrid of such data.

func Wrap Uses

func Wrap(e, s string) string

Wrap wraps a string with an effect or color and appends a reset control code.

func Yellow Uses

func Yellow(s string) string

Yellow makes the string Green.

Package tui imports 6 packages (graph) and is imported by 78 packages. Updated 2019-03-06. Refresh now. Tools for package owners.