You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
471 B
23 lines
471 B
package users
|
|
|
|
import (
|
|
"image"
|
|
"image/color"
|
|
|
|
"github.com/skip2/go-qrcode"
|
|
)
|
|
|
|
func QrForShare(content string) (image.Image, error) {
|
|
qr, err := qrcode.New(content, qrcode.Highest)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
// Optionally, disable the QR Code border.
|
|
qr.DisableBorder = true
|
|
|
|
// Optionally, set the colours.
|
|
qr.ForegroundColor = color.RGBA{R: 0, G: 0, B: 0, A: 255}
|
|
qr.BackgroundColor = color.RGBA{R: 0, G: 0, B: 0, A: 0}
|
|
return qr.Image(254), nil
|
|
}
|