MCPcopy Create free account
hub / github.com/skip2/go-qrcode / TestExampleEncodeWithColourAndWithoutBorder

Function TestExampleEncodeWithColourAndWithoutBorder

example_test.go:34–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestExampleEncodeWithColourAndWithoutBorder(t *testing.T) {
35 q, err := New("https://example.org", Medium)
36 if err != nil {
37 t.Errorf("Error: %s", err)
38 return
39 }
40
41 // Optionally, disable the QR Code border.
42 q.DisableBorder = true
43
44 // Optionally, set the colours.
45 q.ForegroundColor = color.RGBA{R: 0x33, G: 0x33, B: 0x66, A: 0xff}
46 q.BackgroundColor = color.RGBA{R: 0xef, G: 0xef, B: 0xef, A: 0xff}
47
48 err = q.WriteFile(256, "example2.png")
49 if err != nil {
50 t.Errorf("Error: %s", err)
51 return
52 }
53}

Callers

nothing calls this directly

Calls 2

WriteFileMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…