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

Bug in RainbowComet when tail_length > 256 when step=0 #95

Open
richsad opened this issue Mar 31, 2022 · 2 comments
Open

Bug in RainbowComet when tail_length > 256 when step=0 #95

richsad opened this issue Mar 31, 2022 · 2 comments

Comments

@richsad
Copy link

richsad commented Mar 31, 2022

The rainbow comet will be a single red color comet when tail_length is > 256 and step=0. I believe this may be caused by line 63 in the source:

if step == 0: self._colorwheel_step = int(256 / tail_length)
consider tail_length = > 256 and that int() statement can yield 0. When that happens the RainbowComet will be all solid red

perhaps a simple fix is:
if step == 0: self._colorwheel_step = max(int(256 / tail_length), 1)

@richsad
Copy link
Author

richsad commented Mar 31, 2022

hmm, the code got reformatted a bit and failed to include the line feed after the if step == 0: statement

@tekktrik
Copy link
Member

tekktrik commented Apr 1, 2022

Hi @richsad, good catch, want to submit a PR for that fix?

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

No branches or pull requests

2 participants