From 85796c13486d6b436867d20ae93a1451100c4c83 Mon Sep 17 00:00:00 2001 From: Yongwei Xing Date: Fri, 26 Feb 2021 16:10:55 +0800 Subject: [PATCH] add comment --- generativeart.go | 2 ++ go.mod | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 go.mod diff --git a/generativeart.go b/generativeart.go index 5c49d5a..b41ef09 100644 --- a/generativeart.go +++ b/generativeart.go @@ -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) } diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1acc32b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module generativeart + +go 1.14