-
Notifications
You must be signed in to change notification settings - Fork 1
/
style.go
44 lines (37 loc) · 1.2 KB
/
style.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package tooey
import "github.com/gdamore/tcell/v2"
// Color is an integer from -1 to 255
// -1 = ColorClear
// 0-255 = Xterm colors
type Color tcell.Color
// Basic terminal colors
const (
ColorClear tcell.Color = tcell.ColorDefault
ColorBlack tcell.Color = tcell.ColorBlack
ColorRed tcell.Color = tcell.ColorRed
ColorGreen tcell.Color = tcell.ColorGreen
ColorYellow tcell.Color = tcell.ColorYellow
ColorBlue tcell.Color = tcell.ColorBlue
ColorMagenta tcell.Color = tcell.ColorDarkMagenta
ColorCyan tcell.Color = tcell.ColorLightCyan
ColorWhite tcell.Color = tcell.ColorWhite
)
// Style represents the style of one terminal cell
type Style struct {
tcell.Style
Align Alignment
}
// StyleClear represents an empty Style, with no colors or modifiers
var StyleClear = Style{
Style: tcell.StyleDefault,
}
// StyleDefault represents a simple white on black default
var StyleDefault = Style{
Style: tcell.StyleDefault.Foreground(ColorWhite).Background(ColorBlack),
Align: AlignFull,
}
// StyleClassicTerminal is a classic green-on-black terminal styling
var StyleClassicTerminal = Style{
Style: tcell.StyleDefault.Foreground(tcell.ColorLightGreen).Background(tcell.ColorBlack),
Align: AlignFull,
}