Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QR fill #722

Merged
merged 2 commits into from
Dec 21, 2023
Merged

QR fill #722

merged 2 commits into from
Dec 21, 2023

Conversation

BryceStevenWilley
Copy link
Contributor

There are two changes in this PR to make QR codes a bit more accessible.

  • add a white fill behind all QR codes using the SvgPathFillImage class instead of SvgPathImage (both have been in qrcode for a while, shouldn't be any version issues). My only other concern is that people might want the background to match the color of their off-white page, but IMO that group is smaller than those using the default light or dark themes. The fill is changeable with JS, changing the fill attribute of the <svg><rect>... tag.
  • default the alt text of the QR code to include the text of the code itself. I defaulted to "that goes to", since most QR codes are links, but happy to change it something else.

Pre-PR:

Screenshot of a QR code with black squares on a gray background, barely visible

Post-PR:

Screenshot of a QR code with black squares with a white fill, on a gray background

By default makes the QR codes have a white background, so there is always
enough contrast in dark mode for them to be useable.
Ensures that the link is still accessible to those without a separate phone and
using a screen reader.
@jhpyle jhpyle merged commit 78a77ae into jhpyle:master Dec 21, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants