Skip to content

Canva.Options fields are not exported #8

Open
@Elliot67

Description

@Elliot67

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions