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 #6015: rainbowio error for input > 255.0 < 256.0 #6016

Merged
merged 2 commits into from
Feb 11, 2022

Conversation

todbot
Copy link

@todbot todbot commented Feb 11, 2022

Of the two fix options described in #6015, this seems like the more-compatible fix. It guards against the overflow that was happening but doesn't change the method signature. (Which would break all existing code that is sending a float, something I do a lot with stuff like colorwheel( time.monotonic() * 20 )

@todbot todbot changed the title fix #6015 fix #6015: rainbowio error for input > 255.0 < 256.0 Feb 11, 2022
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit 3409243 into adafruit:main Feb 11, 2022
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion to use a macro.

shared-module/rainbowio/__init__.c Show resolved Hide resolved
@todbot
Copy link
Author

todbot commented Feb 13, 2022

Doh, I would've totally used MIN() but for some reason thought it was disallowed or not available.

What's the process for doing tiny cleanup work like this? Another PR?

@tannewt
Copy link
Member

tannewt commented Feb 14, 2022

Doh, I would've totally used MIN() but for some reason thought it was disallowed or not available.

This MIN() is provided by py/misc.h iirc. It isn't a C thing.

What's the process for doing tiny cleanup work like this? Another PR?

Yup, another PR is welcome.

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.

None yet

3 participants