Add a sample style to hello world.

This commit is contained in:
Garrett D'Amore 2021-04-18 12:26:17 -07:00
parent 0c349a85f4
commit 299cb413dc
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ func emitStr(s tcell.Screen, x, y int, style tcell.Style, str string) {
func displayHelloWorld(s tcell.Screen) { func displayHelloWorld(s tcell.Screen) {
w, h := s.Size() w, h := s.Size()
s.Clear() s.Clear()
emitStr(s, w/2-7, h/2, tcell.StyleDefault, "Hello, World!") style := tcell.StyleDefault.Foreground(tcell.ColorCadetBlue.TrueColor()).Background(tcell.ColorWhite)
emitStr(s, w/2-7, h/2, style, "Hello, World!")
emitStr(s, w/2-9, h/2+1, tcell.StyleDefault, "Press ESC to exit.") emitStr(s, w/2-9, h/2+1, tcell.StyleDefault, "Press ESC to exit.")
s.Show() s.Show()
} }