Skip to content

Add colorwheel effect, refactor library #1

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

Merged
merged 13 commits into from
Feb 27, 2022

Conversation

tekktrik
Copy link
Collaborator

@tekktrik tekktrik commented Feb 23, 2022

  1. Adds the colorwheel effect for applicable widget "indicators"! Cycle all the colors!
  2. Refactor the libraries to be able to more flexibly add widgets. Because widgets can vary wildly in how they work and what they do, generalizing effects is a challenge. There's a lot of refactoring here to set the stage for the ability to both be flexible in adding widgets via PR, while having some sort of standardized "methodology" for each effect.

It's worth noting that while the library is new, this is technically API breaking! However the new API should be future proof. Using an enums instead of isinstance() because that would require importing the libraries even if they're not used, which could be a lot if more libraries are ever added. Also didn't want to use __qualname__ or anything like that because that means subclasses won't be recognized. Using explicit enums saves both the memory and allows effects to work for subclasses.

@tekktrik tekktrik requested a review from FoamyGuy February 23, 2022 02:15
Copy link

@FoamyGuy FoamyGuy left a 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 successfully on PyPortal Titano. Great work @tekktrik Thank you.

@FoamyGuy FoamyGuy merged commit c8b9d22 into circuitpython:main Feb 27, 2022
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