Skip to content

Commit

Permalink
Add a sample style to hello world.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Apr 18, 2021
1 parent 0c349a8 commit 299cb41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _demos/hello_world.go
Expand Up @@ -43,7 +43,8 @@ func emitStr(s tcell.Screen, x, y int, style tcell.Style, str string) {
func displayHelloWorld(s tcell.Screen) {
w, h := s.Size()
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.")
s.Show()
}
Expand Down

0 comments on commit 299cb41

Please sign in to comment.