sampler: github.com/sqshq/sampler/console Index | Files

package console

import "github.com/sqshq/sampler/console"

Index

Package Files

console.go palette.go signal.go symbol.go

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 Uses

func Close()

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

func Exit Uses

func Exit(message string)

Exit function exits the program successfully

func GetGradientColor Uses

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

func GetMenuColor Uses

func GetMenuColor() ui.Color

GetMenuColor returns a color based on the operating system target

func GetMenuColorReverse Uses

func GetMenuColorReverse() ui.Color

GetMenuColorReverse returns a color based on the operating system target

func Init Uses

func Init()

type AsciiFont Uses

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

type Palette Uses

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

func GetPalette Uses

func GetPalette(theme Theme) Palette

GetPalette returns a color palette based on specified theme

type Theme Uses

type Theme string
const (
    ThemeDark  Theme = "dark"
    ThemeLight Theme = "light"
)

Package console imports 6 packages (graph) and is imported by 12 packages. Updated 2020-01-03. Refresh now. Tools for package owners.