add comment
This commit is contained in:
parent
37b38f5ba2
commit
85796c1348
2 changed files with 5 additions and 0 deletions
|
@ -19,6 +19,7 @@ type canva struct {
|
||||||
img *image.RGBA
|
img *image.RGBA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewCanva returns a canva.
|
||||||
func NewCanva(h, w int, x, y float64) *canva {
|
func NewCanva(h, w int, x, y float64) *canva {
|
||||||
return &canva{
|
return &canva{
|
||||||
height: h,
|
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) {
|
func (c *canva) FillBackgroud(rgba color.RGBA) {
|
||||||
draw.Draw(c.img, c.img.Bounds(), &image.Uniform{rgba}, image.ZP, draw.Src)
|
draw.Draw(c.img, c.img.Bounds(), &image.Uniform{rgba}, image.ZP, draw.Src)
|
||||||
}
|
}
|
||||||
|
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module generativeart
|
||||||
|
|
||||||
|
go 1.14
|
Loading…
Reference in a new issue