Back to godoc.org
github.com/sqshq/sampler/console

package console

v1.1.0
Latest Go to latest
Published: Dec 24, 2019 | License: GPL3 | Module: github.com/sqshq/sampler

Index

Constants

const (
	MaxRenderInterval = 1000 * time.Millisecond
	MinRenderInterval = 100 * time.Millisecond
	ColumnsCount      = 80
	RowsCount         = 40
	AppTitle          = "sampler"
	AppVersion        = "1.1.0"
)
const (
	ColorOlive       ui.Color = 178
	ColorDeepSkyBlue ui.Color = 39
	ColorDeepPink    ui.Color = 198
	ColorCian        ui.Color = 43
	ColorOrange      ui.Color = 166
	ColorPurple      ui.Color = 129
	ColorGreen       ui.Color = 64
	ColorDarkRed     ui.Color = 88
	ColorBlueViolet  ui.Color = 57
	ColorDarkGrey    ui.Color = 238
	ColorLightGrey   ui.Color = 254
	ColorGrey        ui.Color = 242
	ColorWhite       ui.Color = 15
	ColorBlack       ui.Color = 0
	ColorClear       ui.Color = -1
)
const (
	SignalResize = "<Resize>"
	SignalClick  = "<MouseLeft>"
)
const (
	KeyPause1 = "p"
	KeyPause2 = "P"
	KeyQuit1  = "q"
	KeyQuit2  = "Q"
	KeyQuit3  = "<C-c>"
	KeyLeft   = "<Left>"
	KeyRight  = "<Right>"
	KeyUp     = "<Up>"
	KeyDown   = "<Down>"
	KeyEnter  = "<Enter>"
	KeyEsc    = "<Escape>"
)
const (
	SymbolSelection     rune = '▲'
	SymbolVerticalBar   rune = '▎'
	SymbolHorizontalBar rune = '═'
)
const (
	BellCharacter = "\a"
)

func Close

func Close()

Close function calls Close from termui package, which closes termbox-go

func Exit

func Exit(message string)

Exit function exits the program successfully

func GetGradientColor

func GetGradientColor(gradient []ui.Color, cur int, max int) ui.Color

func GetMenuColor

func GetMenuColor() ui.Color

GetMenuColor returns a color based on the operating system target

func GetMenuColorReverse

func GetMenuColorReverse() ui.Color

GetMenuColorReverse returns a color based on the operating system target

func Init

func Init()

type AsciiFont

type AsciiFont string
const (
	AsciiFont2D AsciiFont = "2d"
	AsciiFont3D AsciiFont = "3d"
)

type Palette

type Palette struct {
	ContentColors  []ui.Color
	GradientColors [][]ui.Color
	BaseColor      ui.Color
	MediumColor    ui.Color
	ReverseColor   ui.Color
}

func GetPalette

func GetPalette(theme Theme) Palette

GetPalette returns a color palette based on specified theme

type Theme

type Theme string
const (
	ThemeDark  Theme = "dark"
	ThemeLight Theme = "light"
)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier