Documentation ¶
Index ¶
Constants ¶
View Source
const ( DOT = '•' ELLIPSES = '…' UP_ARROW = '▲' DOWN_ARROW = '▼' COLLAPSED = '+' EXPANDED = '−' )
Variables ¶
View Source
var ( BARS = [...]rune{' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'} SHADED_BLOCKS = [...]rune{' ', '░', '▒', '▓', '█'} IRREGULAR_BLOCKS = [...]rune{ ' ', '▘', '▝', '▀', '▖', '▌', '▞', '▛', '▗', '▚', '▐', '▜', '▄', '▙', '▟', '█', } BRAILLE_OFFSET = '\u2800' BRAILLE = [4][2]rune{ {'\u0001', '\u0008'}, {'\u0002', '\u0010'}, {'\u0004', '\u0020'}, {'\u0040', '\u0080'}, } DOUBLE_BRAILLE = map[[2]int]rune{ [2]int{0, 0}: '⣀', [2]int{0, 1}: '⡠', [2]int{0, 2}: '⡐', [2]int{0, 3}: '⡈', [2]int{1, 0}: '⢄', [2]int{1, 1}: '⠤', [2]int{1, 2}: '⠔', [2]int{1, 3}: '⠌', [2]int{2, 0}: '⢂', [2]int{2, 1}: '⠢', [2]int{2, 2}: '⠒', [2]int{2, 3}: '⠊', [2]int{3, 0}: '⢁', [2]int{3, 1}: '⠡', [2]int{3, 2}: '⠑', [2]int{3, 3}: '⠉', } SINGLE_BRAILLE_LEFT = [4]rune{'\u2840', '⠄', '⠂', '⠁'} SINGLE_BRAILLE_RIGHT = [4]rune{'\u2880', '⠠', '⠐', '⠈'} )
View Source
var BaseColors = []Color{ ColorBlack, ColorRed, ColorGreen, ColorYellow, ColorBlue, ColorMagenta, ColorCyan, ColorWhite, }
View Source
var BaseStyles = []Style{ view.NewStyle(ColorBlack), view.NewStyle(ColorRed), view.NewStyle(ColorGreen), view.NewStyle(ColorYellow), view.NewStyle(ColorBlue), view.NewStyle(ColorMagenta), view.NewStyle(ColorCyan), view.NewStyle(ColorWhite), }
View Source
var StyleClear = Style{Fg: ColorClear, Bg: ColorClear, Modifier: ModifierClear}
View Source
var StyledParserColorMap = map[string]Color{ "black": ColorBlack, "red": ColorRed, "green": ColorGreen, "yellow": ColorYellow, "blue": ColorBlue, "magenta": ColorMagenta, "cyan": ColorCyan, "white": ColorWhite, }
View Source
var Theme = BaseTheme{ Default: view.NewStyle(ColorWhite), Module: ModuleTheme{ Title: view.NewStyle(ColorWhite), Border: view.NewStyle(ColorWhite), }, Text: TextTheme{ Text: view.NewStyle(ColorWhite), }, }
Functions ¶
Types ¶
type BaseTheme ¶
type BaseTheme struct { Default Style // Put module themes here Module ModuleTheme Text TextTheme }
BaseTheme is where all the mappings for modules and the corresponding Type, which defines the expected properties for that module are defined. For instance, the Text module is mapped to the TextTheme struct, which expects a single property, Text, which holds the property for the color of the text.
To add a new module, first create an exported struct with the required properties (types set to Color or Style), and then add it to the BaseTheme struct. Naming convention should be to use the name of the module followed by theme for the struct name, and using only the module name for the property name in BaseTheme.
type ModuleTheme ¶
Click to show internal directories.
Click to hide internal directories.