From 299cb413dc87b63a30167f8a56f018e7fc67f391 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 18 Apr 2021 12:26:17 -0700 Subject: [PATCH] Add a sample style to hello world. --- _demos/hello_world.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_demos/hello_world.go b/_demos/hello_world.go index 231d4126..196f0a52 100644 --- a/_demos/hello_world.go +++ b/_demos/hello_world.go @@ -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() }