mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
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:
parent
78732d93f6
commit
45642668f7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user