Browse Source

bgClr is always zero, no need to set

wangbei 7 years ago
parent
commit
4444a7dc51
1 changed files with 0 additions and 5 deletions
  1. 0 5
      qrcode.go

+ 0 - 5
qrcode.go

@@ -293,13 +293,8 @@ func (q *QRCode) Image(size int) image.Image {
 	// Saves a few bytes to have them in this order
 	p := color.Palette([]color.Color{q.BackgroundColor, q.ForegroundColor})
 	img := image.NewPaletted(rect, p)
-	bgClr := uint8(img.Palette.Index(q.BackgroundColor))
 	fgClr := uint8(img.Palette.Index(q.ForegroundColor))
 
-	for i := range img.Pix {
-		img.Pix[i] = bgClr
-	}
-
 	bitmap := q.symbol.bitmap()
 	for y, row := range bitmap {
 		for x, v := range row {