Documentation ¶
Index ¶
- type BullEyeStyle
- type CodePointStyle
- type PersonaQrCode
- func (p *PersonaQrCode) Background(col color.Color)
- func (p *PersonaQrCode) BullEye(os, is BullEyeStyle)
- func (p *PersonaQrCode) CodePoint(s CodePointStyle, r float64)
- func (p *PersonaQrCode) ForeImage(img image.Image, bullEye bool)
- func (p *PersonaQrCode) Foreground(col color.Color)
- func (p *PersonaQrCode) Logo(img image.Image, border bool)
- func (p *PersonaQrCode) Result(border bool) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BullEyeStyle ¶
type BullEyeStyle int
const ( // BesRectangle 矩形 BesRectangle BullEyeStyle = iota // BesRoundedRectangle 圆角矩形 BesRoundedRectangle // BesCircular 圆形 BesCircular // BesRhombus 菱形 BesRhombus )
type CodePointStyle ¶
type CodePointStyle int
const ( // CpsRectangle 矩形 CpsRectangle CodePointStyle = iota // CpsRoundedRectangle 圆角矩形 CpsRoundedRectangle // CpsCircular 圆形 CpsCircular // CpsRhombus 菱形 CpsRhombus // CpsIsoscelesTop 等边三角形 CpsIsoscelesTop // CpsIsoscelesBottom 尖部向下的等边三角形 CpsIsoscelesBottom )
type PersonaQrCode ¶
type PersonaQrCode struct { Error error // contains filtered or unexported fields }
func New ¶
func New(text string, size int, level qrcode.RecoveryLevel) *PersonaQrCode
New Create a new QR code processor `text`: Contents of QR Code `size`: Size of QR code `level`: Error correction level of two-dimensional code
func (*PersonaQrCode) Background ¶
func (p *PersonaQrCode) Background(col color.Color)
Background color of the QR code Translucent colors are not recommended
func (*PersonaQrCode) BullEye ¶
func (p *PersonaQrCode) BullEye(os, is BullEyeStyle)
BullEye Draw the bull's eye area
`os`: Bull eye outside style `is`: Bull eye inside style
func (*PersonaQrCode) CodePoint ¶
func (p *PersonaQrCode) CodePoint(s CodePointStyle, r float64)
CodePoint Draw the two-dimensional code content area This method should be executed before BullEye
`s`: The style of the code point `r`: The size of the code point The value ranges from 0.1 to 1
func (*PersonaQrCode) ForeImage ¶
func (p *PersonaQrCode) ForeImage(img image.Image, bullEye bool)
ForeImage Foreground color values are based on the image Note that the selected image should not appear transparent or consistent with the background color `bullEye`: Whether to extend the color of the picture to ox eyes. If it is false take the foreground color This method should be executed before CodePoint and BullEye
func (*PersonaQrCode) Foreground ¶
func (p *PersonaQrCode) Foreground(col color.Color)
Foreground color of the QR code Translucent colors are not recommended