lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.34k stars 664 forks source link

Styled QR Codes turn entirely black when back_color is black/(0, 0, 0) #246

Open its-just-Chloe opened 2 years ago

its-just-Chloe commented 2 years ago

I have noticed that when you use a color mask and set back_ground to (0, 0, 0) the entire QR Code turns black.

img = self.qr.make_image(image_factory=StyledPilImage, color_mask=SolidFillColorMask(
                                          back_color=(255, 0, 0),
                                          front_color=(255, 255, 255))

this works normally

img = self.qr.make_image(image_factory=StyledPilImage, color_mask=SolidFillColorMask(
                                          back_color=(0, 0, 0),
                                          front_color=(255, 255, 255))

but this returns an entirely black QR Code no matter the front_color value. Tried several things and (1, 0, 0) works for example but this is not really a satisfying workaround.

hypnobrando commented 2 years ago

I'm also experiencing this issue