Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canva.Options fields are not exported #8

Open
Elliot67 opened this issue Oct 30, 2021 · 0 comments
Open

Canva.Options fields are not exported #8

Elliot67 opened this issue Oct 30, 2021 · 0 comments

Comments

@Elliot67
Copy link

We currently cannot use the Options struct for the SetOptions() method because its fields aren't exported.

Had to use the helpers function instead :

type OptionsOverride struct {
	Background  color.RGBA
	Foreground  color.RGBA
	LineColor   color.RGBA
	LineWidth   float64
	ColorSchema []color.RGBA
	NIters      int
	Alpha       int
}

func setCanvaOptions(c *generativeart.Canva, options OptionsOverride) {
	c.SetBackground(options.Background)
	c.SetForeground(options.Foreground)
	c.SetLineColor(options.LineColor)
	c.SetLineWidth(options.LineWidth)
	c.SetColorSchema(options.ColorSchema)
	c.SetIterations(options.NIters)
	c.SetAlpha(options.Alpha)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant