-
Notifications
You must be signed in to change notification settings - Fork 25
update to show_business_card in pybadger_base.py #49
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
Conversation
Updated code to allow for background_color to be set for box around text in business card or custom. None = Transparent, Color number Hex = background box color.
Update to use font-color with background color in custom business card.
Hello @liltux. Thanks for contributing this enhancement. We use Black and PyLint as well as a few other tools to ensure the code formatting across all of the many different libraries is consistent. The actions checks have not passed on this PR due to the formatting be off a little bit. You can learn about how to set it up and run it in this guide, here is the page on Black specifically: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/black there is a page for PyLint as well which might become an issue once the formatting is resolved (but maybe not also). To make it easier all of the checks are combined into 1 by a tool called pre-commit. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code installing and using that is the easiest way to get all of the checks to run locally. Then you can make any changes needed and make a new commit / push which should pass in the github actions if it's also passing locally for you. Please give this a try and make a new commit / push. If you run into trouble you can reply back here or on the discord: https://adafru.it/discord and myself or other folks can help you work through any issues that you run into. |
@FoamyGuy Thanks! I now have a todo list. Time to tinker some more. |
black check should succeed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work. Thanks again for adding this new feature! And thank you as well for working through the formatting issues to get it passing the checks.
I tested this out and it is working as expected. I have one minor request with regards to the name of one of the arguments, but beyond that this change looks good to me.
@liltux okay I was able to remove that and now I know the correct command to run no so I can share that:
this command will remove the I added I pushed those changes to your branch so that they will show up automatically here in the PR without you needing to do anything else. If you do end up needing or wanting to make more changes in this branch you'll likely have to either pull these changes, or else re-clone a new copy of the branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Tested the latest version successfully on PyGamer 7.0.0 alpha5.
It looks like this might your first contribution to a CircuitPython library, if that is the case congratulations 🎉
Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9600 to 1.2.0 from 1.1.6: > Merge pull request adafruit/Adafruit_CircuitPython_MCP9600#16 from kattni/mcp9601 > Moved default branch to main > Moved CI to Python 3.7 > Added help text and problem matcher > Added pull request template Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.5.1 from 3.5.0: > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#49 from liltux/tinkerd
Added a few lines to breakout option to set background color and font color when setting text lines for show_business_card.
This is my first time playing around with adafruit_pybadger library, and I found the default text color, 0xFFFFFF, and transparent background, did not work with my white image.
After looking through, the ability was there, just not made available through the pybadger show_business_card.
I am not a pro - coder, mere tinkerer, so there may be a better way to accomplish this, but just thought I would throw it out there and see what you all thought.
I can now do this:
pybadger.show_business_card( background_color=0xFFFFFF, font_color=0x0000FF, ...
which makes my font more readable on a white image pallette. Thanks!