Skip to content

Commit

Permalink
Better colors for mouse demo (brighter).
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Feb 21, 2023
1 parent 7b5fe1f commit 5db823e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions _demos/mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5db823e

Please sign in to comment.