Skip to content

Instantly share code, notes, and snippets.

@NetguruGist
Created November 28, 2016 13:38
Show Gist options
  • Save NetguruGist/89af091b816b985dcb27aa6bbecb6328 to your computer and use it in GitHub Desktop.
Save NetguruGist/89af091b816b985dcb27aa6bbecb6328 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"image/color"
"time"
"github.com/szeliga/goray/engine"
)
func main() {
var width = 200
var height = 200
scene := engine.NewScene(width, height)
scene.EachPixel(func(x, y int) color.RGBA {
return color.RGBA{
uint8(x * 255 / width),
uint8(y * 255 / height),
100,
255,
}
})
scene.Save(fmt.Sprintf("./renders/%d.png", time.Now().Unix()))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment