Created
November 28, 2016 13:33
-
-
Save NetguruGist/55b90a1976f05aff210eb57d79e48bf3 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
| func generateImage(w, h int, pixelColor color.RGBA) *image.RGBA { | |
| img := image.NewRGBA(image.Rect(0, 0, 4, 4)) | |
| for x := 0; x < 4; x++ { | |
| for y := 0; y < 4; y++ { | |
| img.Set(x, y, pixelColor) | |
| } | |
| } | |
| return img | |
| } | |
| func randomColor() color.RGBA { | |
| rand := rand.New(rand.NewSource(time.Now().Unix())) | |
| return color.RGBA{uint8(rand.Intn(255)), uint8(rand.Intn(255)), uint8(rand.Intn(255)), 255} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment