add comment

This commit is contained in:
Yongwei Xing 2021-02-26 16:10:55 +08:00
parent 37b38f5ba2
commit 85796c1348
2 changed files with 5 additions and 0 deletions

View file

@ -19,6 +19,7 @@ type canva struct {
img *image.RGBA
}
// NewCanva returns a canva.
func NewCanva(h, w int, x, y float64) *canva {
return &canva{
height: h,
@ -29,6 +30,7 @@ func NewCanva(h, w int, x, y float64) *canva {
}
}
// FillBackgroud fills the backgroud of the canva.
func (c *canva) FillBackgroud(rgba color.RGBA) {
draw.Draw(c.img, c.img.Bounds(), &image.Uniform{rgba}, image.ZP, draw.Src)
}

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module generativeart
go 1.14