examples/cursor: Change the background colors

On Windows, cursor colors are determined based on the background
color, and if the background color is gray, the cursor might be
invisible. This change adjust the color so that the cursor should
be visible in any cases.

Closes #1583
This commit is contained in:
Hajime Hoshi 2021-04-18 19:34:51 +09:00
parent 78732d93f6
commit 45642668f7

View File

@ -79,11 +79,16 @@ func main() {
gridColors: map[image.Rectangle]color.Color{},
}
for rect, c := range g.grids {
a := byte(0x40)
if c%2 == 0 {
a += 0x40
clr := color.RGBA{0x40, 0x40, 0x40, 0xff}
switch c % 3 {
case 0:
clr.R = 0x80
case 1:
clr.G = 0x80
case 2:
clr.B = 0x80
}
g.gridColors[rect] = color.Alpha{a}
g.gridColors[rect] = clr
}
ebiten.SetWindowSize(screenWidth, screenHeight)