diff --git a/_docs/public/hue.gif b/_docs/public/hue.gif index c10ce3584..a0a754b74 100644 Binary files a/_docs/public/hue.gif and b/_docs/public/hue.gif differ diff --git a/_docs/public/index.html b/_docs/public/index.html index d93f7941a..357ae2e77 100644 --- a/_docs/public/index.html +++ b/_docs/public/index.html @@ -244,7 +244,7 @@ func update(screen *ebiten.Image) error { count++ w, h := gophersImage.Size() geo := ebiten.TranslateGeo(-float64(w)/2, -float64(h)/2) - geo.Concat(ebiten.RotateGeo(float64(count%720) * 2 * math.Pi / 720)) + geo.Concat(ebiten.RotateGeo(float64(count%360) * 2 * math.Pi / 360)) geo.Concat(ebiten.TranslateGeo(screenWidth/2, screenHeight/2)) if err := screen.DrawImage(gophersImage, &ebiten.DrawImageOptions{ GeoM: geo, diff --git a/_docs/public/rotate.gif b/_docs/public/rotate.gif index 5ef3c3754..5372dcdba 100644 Binary files a/_docs/public/rotate.gif and b/_docs/public/rotate.gif differ diff --git a/ebitenutil/gif.go b/ebitenutil/gif.go index b8623578c..d8f0f08e7 100644 --- a/ebitenutil/gif.go +++ b/ebitenutil/gif.go @@ -35,15 +35,18 @@ type recorder struct { wg sync.WaitGroup } -var cheapPalette = color.Palette{ - color.RGBA{0x00, 0x00, 0x00, 0xff}, - color.RGBA{0xff, 0x00, 0x00, 0xff}, - color.RGBA{0x00, 0xff, 0x00, 0xff}, - color.RGBA{0x00, 0x00, 0xff, 0xff}, - color.RGBA{0xff, 0xff, 0x00, 0xff}, - color.RGBA{0xff, 0x00, 0xff, 0xff}, - color.RGBA{0x00, 0xff, 0xff, 0xff}, - color.RGBA{0xff, 0xff, 0xff, 0xff}, +var cheapPalette color.Palette + +func init() { + cs := []color.Color{} + for _, r := range []uint8{0x00, 0x80, 0xff} { + for _, g := range []uint8{0x00, 0x80, 0xff} { + for _, b := range []uint8{0x00, 0x80, 0xff} { + cs = append(cs, color.RGBA{r, g, b, 0xff}) + } + } + } + cheapPalette = color.Palette(cs) } func (r *recorder) delay() int { diff --git a/example/rotate/main.go b/example/rotate/main.go index 73db50e71..022e5e8cf 100644 --- a/example/rotate/main.go +++ b/example/rotate/main.go @@ -36,7 +36,7 @@ func update(screen *ebiten.Image) error { count++ w, h := gophersImage.Size() geo := ebiten.TranslateGeo(-float64(w)/2, -float64(h)/2) - geo.Concat(ebiten.RotateGeo(float64(count%720) * 2 * math.Pi / 720)) + geo.Concat(ebiten.RotateGeo(float64(count%360) * 2 * math.Pi / 360)) geo.Concat(ebiten.TranslateGeo(screenWidth/2, screenHeight/2)) if err := screen.DrawImage(gophersImage, &ebiten.DrawImageOptions{ GeoM: geo,