Exercise: Images
Remember the picture generator from before? Time to revisit it — but this time, return an image.Image instead of a raw slice.
Define your own Image type and implement the three methods the image.Image interface requires:
Boundsshould returnimage.Rect(0, 0, w, h)ColorModelshould returncolor.RGBAModelAtshould return a color — usecolor.RGBA{v, v, 255, 255}wherevis whatever pixel formula you like
Then call pic.ShowImage with your type and see the result.