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

Update Raindrops effect to respect LED range limits #24531

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

filterpaper
Copy link
Contributor

@filterpaper filterpaper commented Oct 26, 2024

Description

Improved effect with update to LED within led_min and led_max limits

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Oct 26, 2024
@filterpaper filterpaper force-pushed the raindrops-ledlimits branch 4 times, most recently from 2b3e7c2 to 3e264f3 Compare October 27, 2024 04:34
@filterpaper filterpaper marked this pull request as draft October 27, 2024 04:45
@filterpaper filterpaper marked this pull request as ready for review October 27, 2024 04:48
quantum/rgb_matrix/animations/raindrops_anim.h Outdated Show resolved Hide resolved
quantum/rgb_matrix/animations/raindrops_anim.h Outdated Show resolved Hide resolved
@filterpaper
Copy link
Contributor Author

Actually you may even keep the old raindrops_set_color() implementation — the only important thing is to call it on the appropriate rendering iteration, so that the LED index is within the range which should be updated

The slight challenge is to avoid updating the LED again until idx has a new random value. The rgb variable is avoided with now by setting idx out of range after an update. Let me know if there's a better suggestion.

Improved effect to update LED index within `led_min` and `led_max` limits
@filterpaper filterpaper force-pushed the raindrops-ledlimits branch 3 times, most recently from 230805e to c1fd315 Compare October 27, 2024 23:21
Set index out of range after trigger
@drashna drashna requested a review from a team October 28, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants