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.

24 lines
487 B

package share_img
import (
"image"
"image/color"
"github.com/skip2/go-qrcode"
)
func QrForShare(content string, size int) (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(size), nil
}