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

Fix #9 Background color #12

Merged
merged 7 commits into from
Dec 15, 2019
Merged

Conversation

abousquet
Copy link
Contributor

I have added the :background_color option to both SVG and PNG images. Both image types default this option to white. SVG's implementation allows for transparency as well by passing the :transparent as the value.

Work left to do:

  • Add transparency to PNG images as well
  • Create visual/manual verification tests for both image types

@abousquet abousquet changed the title WIP: Background color #9 Background color Dec 14, 2019
@abousquet abousquet changed the title #9 Background color SiliconJungles/eqrcode#9 Background color Dec 14, 2019
@abousquet abousquet changed the title SiliconJungles/eqrcode#9 Background color Fix #9 Background color Dec 14, 2019
@abousquet
Copy link
Contributor Author

I've added two test modules for PNG and SVG, respectively. They generate an html page in test/html that renders generated QR codes that point to www.google.com with various options. The PNG files had to be saved to disk in test/images. Both of these directories are created if they do not exist and are ignored by git.

I've added transparency to PNG by changing the color type from 2 to 6, in order to add an extra byte for alpha channel.

Lastly, I cleaned up the SVG module to use elixir pattern matching and the pipe operator.

@abousquet abousquet marked this pull request as ready for review December 14, 2019 18:54
@nthock nthock merged commit dd973ba into SiliconJungles:master Dec 15, 2019
@nthock
Copy link
Collaborator

nthock commented Dec 15, 2019

Thanks for the PR. Will update the hex package soon with this commit.

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