Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "golang.org/x/tour/pic"
- import (
- "image"
- "image/color"
- )
- type Image struct{}
- func (m Image) ColorModel() color.Model {
- return color.RGBAModel
- }
- func (m Image) Bounds() image.Rectangle {
- return image.Rect(0, 0, 255, 255)
- }
- func (m Image) At(x, y int) color.Color {
- var v = uint8(x*y)
- return color.RGBA{v, v, 255, 255}
- }
- func main() {
- m := Image{}
- pic.ShowImage(m)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement