-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ColorFromPaletteWLED: improved speed and fixed issue #4524
Conversation
DedeHai
commented
Jan 27, 2025
- fixed issue: blending was also done when color was on a key-index-color which is now skipped
- speed improvement: conversion is skipped if color is key-color
- fixed issue: blending was also done when color was on a key-index-color which is now skipped - speed improvement: conversion is skipped if color is key-color
After our (me and @DedeHai) discussion on Discord, I experimented a bit about performance and the original version (without color_fade()) performs best (twice as fast as when using color_blend() and color_fade()) at the expense of readability. IMO only adding check for lo4 is enough to fix the issue that caused the change. |
- ran a few more tests, it is 30% faster like it was originally so reverting. The conversion to 32bit color appears to be wasteful in resources.
@blazoncek is correct, I tested again and the original was actually faster. I thought the final scaling could be done in 32bit at similar speed but apparently that is not the case. Reverted some of the changes. |
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.
👍
@DedeHai this wasn't merged to 0_15_x and throws conflict when i try. Can you take a look please? |
@netmindz this was mislabelled, the fix is for a function added after 0.15 so it does not apply |