how to run code #9
Replies: 5 comments 18 replies
-
It's all documented, try those steps:
package main
import (
"math/rand"
"time"
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(500, 500)
c.SetBackground(common.Black)
c.FillBackground()
c.SetColorSchema(common.DarkRed)
c.SetForeground(common.LightPink)
c.Draw(arts.NewJanus(10, 0.2))
c.ToPNG("janus.png")
} |
Beta Was this translation helpful? Give feedback.
-
can you explain first steps in more detail. I don't know too much about it |
Beta Was this translation helpful? Give feedback.
-
please explain initialize step also
…On Mon, Feb 28, 2022, 3:43 PM Aleksander Borowski ***@***.***> wrote:
It's all documented, try those steps:
- create your project folder and enter that folder mkdir generativeart
&& cd generativeart
- initialize your go project with go mod init generativeart
- download required packages
- go get github.com/jdxyw/generativeart
- go get github.com/jdxyw/generativeart/arts
- copy any main from examples:
package main
import (
"math/rand"
"time"
"github.com/jdxyw/generativeart"
"github.com/jdxyw/generativeart/arts"
"github.com/jdxyw/generativeart/common"
)
func main() {
rand.Seed(time.Now().Unix())
c := generativeart.NewCanva(500, 500)
c.SetBackground(common.Black)
c.FillBackground()
c.SetColorSchema(common.DarkRed)
c.SetForeground(common.LightPink)
c.Draw(arts.NewJanus(10, 0.2))
c.ToPNG("janus.png")
}
- run the code with go run .
- enjoy your image janus.png
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWNA7B2L3PJBMWMM4T6XGHDU5NGTXANCNFSM5PQV2MSQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
how can I change colors and save output file (.PNG) |
Beta Was this translation helpful? Give feedback.
-
it shows an error when I write any other colors. |
Beta Was this translation helpful? Give feedback.
-
hello brother, this art is really amazing(contour line, noise line and dot line). I'm trying for 2 week to run the code but it's not working. Can you guide how to run and setup files.
Beta Was this translation helpful? Give feedback.
All reactions