qrcode

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment struct {
	Color   string  `json:"color"`
	Stroke  string  `json:"stroke"`
	Rounded float64 `json:"rounded"`
}

type Background

type Background struct {
	Color   string  `json:"color"`
	Rounded float64 `json:"rounded"`
	Stroke  string  `json:"stroke,omitempty"`
	Dashed  string  `json:"dashed,omitempty"` // "cornered", "circular", "full", "none"
	Border  float64 `json:"border,omitempty"` // border thickness
}

func (Background) DashArray

func (bg Background) DashArray(canvasSize float64) float64

func (Background) DashOffset

func (bg Background) DashOffset(canvasSize float64) float64

func (Background) Perimeter

func (bg Background) Perimeter(canvasSize float64) float64

func (Background) Side

func (bg Background) Side(canvasSize float64) float64

type Cell

type Cell struct {
	Color    string    `json:"color"`
	Size     float64   `json:"size"`
	Rounded  float64   `json:"rounded"`
	Opacity  float64   `json:"opacity"`
	Gradient *Gradient `json:"gradient,omitempty"`
}

type Cells

type Cells struct {
	Active    Cell `json:"active"`
	Passive   Cell `json:"inactive"`
	Center    Cell `json:"center"`
	Alignment Cell `json:"alignment"`
}

type Center

type Center struct {
	Image      string  `json:"image"`
	Background string  `json:"background"`
	Stroke     string  `json:"stroke"`
	Shape      string  `json:"shape"`
	Size       float64 `json:"size"`
	Padding    float64 `json:"padding"`
}

type Dash

type Dash struct {
	Array  float64
	Offset float64
}

type Finder

type Finder struct {
	Color    string    `json:"color"`
	Stroke   string    `json:"stroke"`
	Rounded  float64   `json:"rounded"`
	Gradient *Gradient `json:"gradient,omitempty"`
}

type Finders

type Finders struct {
	TopLeft    Finder `json:"top_left"`
	TopRight   Finder `json:"top_right"`
	BottomLeft Finder `json:"bottom_left"`
}

type Gradient

type Gradient struct {
	Type   string   `json:"type"`   // "linear" or "radial"
	Colors []string `json:"colors"` // hex gradient colors
	Angle  float64  `json:"angle"`  // linear gradient angle
}

type Options

type Options struct {
	Data     string
	Template string

	Padding int
	Level   qrcode.RecoveryLevel
	Size    int

	Cells      Cells
	Center     Center
	Finders    Finders
	Background Background

	Alignment Alignment
	Merge     bool `json:"merge,omitempty"`
}

func (*Options) ExtractLogoColors

func (o *Options) ExtractLogoColors() ([]string, error)

func (*Options) Png

func (o *Options) Png() ([]byte, error)

func (*Options) Svg

func (o *Options) Svg() (string, error)

type Stroke

type Stroke struct {
	Size  float64
	Color string
	Dash  Dash
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL