From 5db823e7a8fb079e5b5d723ef4c9cb9c30d0ff7b Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 20 Feb 2023 16:01:55 -0800 Subject: [PATCH] Better colors for mouse demo (brighter). --- _demos/mouse.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/_demos/mouse.go b/_demos/mouse.go index 4a1f330..394808f 100644 --- a/_demos/mouse.go +++ b/_demos/mouse.go @@ -268,12 +268,23 @@ func main() { if button != tcell.ButtonNone && ox < 0 { ox, oy = x, y } + theme := []tcell.Color{ + tcell.ColorGray, + tcell.ColorRed, + tcell.ColorLime, + tcell.ColorYellow, + tcell.ColorFuchsia, + tcell.ColorBlue, + tcell.ColorAqua, + tcell.ColorSilver, + } switch ev.Buttons() { case tcell.ButtonNone: if ox >= 0 { - bg := tcell.Color((lchar-'0')*2) | tcell.ColorValid + bg := theme[(lchar-'0') % 8] + fg := tcell.ColorBlack drawBox(s, ox, oy, x, y, - up.Background(bg), + up.Background(bg).Foreground(fg), lchar) ox, oy = -1, -1 bx, by = -1, -1