Option to invert QR code
sbliven opened this issue · 3 comments
I'm opening this issue because:
-
I have found a bug
-
I want to request a feature
-
I have a question
-
Other
-
My Go version is: go1.20.5 darwin/arm64
-
My GOPATH is set to: ""
-
QRCP version: 0.10.1 (homebrew)
The text-based QR codes currently have character FULL BLOCK (0xE29688) for white pixels and SPACE (0x20) for black pixels. This works for terminals with white text on black backgrounds or similar dark themes, but fails for light themes. I suggest adding an option to invert the characters for QR code generation.
Another option would be adding ANSI codes for black and white to the output, but this sounds error prone to me since terminals might redefine black and white text.
Note that #150 recommends --browser
as a work around. This works, but one of the main attractions of qrcp is that it works from the command line without interrupting my workflow like GUI tools.
Hello @sbliven , thanks for the suggestion!
The QR code generation is delegated to the skip2/go-qrcode package, I will have a look and see if it's possible to invert colors.
Thanks,
Claudio
go-qrcode supports this. I've gone ahead and made a PR for this feature.