- package main
+ // hue
+
+package main
import (
"github.com/hajimehoshi/ebiten"
@@ -59,10 +76,10 @@ var (
func update(screen *ebiten.Image) error {
count++
w, h := gophersImage.Size()
- geo := ebiten.TranslateGeo(float64(screenWidth - w)/2, float64(screenHeight - h) / 2)
+ geo := ebiten.TranslateGeo(float64(screenWidth-w)/2, float64(screenHeight-h)/2)
clr := ebiten.RotateHue(float64(count%360) * 2 * math.Pi / 360)
if err := screen.DrawImage(gophersImage, &ebiten.DrawImageOptions{
- GeoM: geo,
+ GeoM: geo,
ColorM: clr,
}); err != nil {
return err
@@ -85,7 +102,9 @@ func main() {
|
|