Created
November 28, 2016 13:38
-
-
Save NetguruGist/89af091b816b985dcb27aa6bbecb6328 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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