-
Notifications
You must be signed in to change notification settings - Fork 260
/
style.go
89 lines (83 loc) · 2.69 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package main
import (
"github.com/charmbracelet/lipgloss"
)
// Theme colors.
const (
Background = "#171717"
Foreground = "#dddddd"
Black = "#282a2e" // ansi 0
BrightBlack = "#4d4d4d" // ansi 8
Red = "#D74E6F" // ansi 1
BrightRed = "#FE5F86" // ansi 9
Green = "#31BB71" // ansi 2
BrightGreen = "#00D787" // ansi 10
Yellow = "#D3E561" // ansi 3
BrightYellow = "#EBFF71" // ansi 11
Blue = "#8056FF" // ansi 4
BrightBlue = "#9B79FF" // ansi 12
Magenta = "#ED61D7" // ansi 5
BrightMagenta = "#FF7AEA" // ansi 13
Cyan = "#04D7D7" // ansi 6
BrightCyan = "#00FEFE" // ansi 14
White = "#bfbfbf" // ansi 7
BrightWhite = "#e6e6e6" // ansi 15
Indigo = "#5B56E0"
)
const (
defaultColumns = 80
defaultHeight = 600
defaultMaxColors = 256
defaultPadding = 60
defaultWindowBarSize = 30
defaultPlaybackSpeed = 1.0
defaultWidth = 1200
)
// Styles for syntax highlighting
var (
CommandStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("12"))
FaintStyle = lipgloss.NewStyle().Foreground(lipgloss.AdaptiveColor{Light: "242", Dark: "238"})
NoneStyle = lipgloss.NewStyle()
KeywordStyle = lipgloss.NewStyle()
URLStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("3"))
NumberStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("3"))
StringStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("10"))
TimeStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("11"))
LineNumberStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
ErrorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("1"))
GrayStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
ErrorFileStyle = lipgloss.NewStyle().
Border(lipgloss.NormalBorder()).
BorderForeground(lipgloss.Color("8")).
Foreground(lipgloss.Color("1")).
Padding(0, 1).
Width(defaultColumns)
)
// StyleOptions represents the ui options for video and screenshots.
type StyleOptions struct {
Width int
Height int
Padding int
BackgroundColor string
MarginFill string
Margin int
WindowBar string
WindowBarSize int
WindowBarColor string
BorderRadius int
}
// DefaultStyleOptions returns default Style config.
func DefaultStyleOptions() *StyleOptions {
return &StyleOptions{
Width: defaultWidth,
Height: defaultHeight,
Padding: defaultPadding,
MarginFill: DefaultTheme.Background,
Margin: 0,
WindowBar: "",
WindowBarSize: defaultWindowBarSize,
WindowBarColor: DefaultTheme.Background,
BorderRadius: 0,
BackgroundColor: DefaultTheme.Background,
}
}