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

APA102 Brightness function could use the 5-bit brightness value instead of scaling the component values. #58

Open
zackees opened this issue Oct 24, 2023 · 0 comments

Comments

@zackees
Copy link

zackees commented Oct 24, 2023

In the Adafruit_DotStar library that brightness is implemented via scaling down the led values, similar to the WS2812. But DotStar contains a 5-bit brightness value that if used, will preserve the color resolution. The downside is that there would only be 32 brightness levels rather than the 256.

FastLED enables something similar via the global brightness #define.

Since I just submitted a PR already for this code base, I might implement this for Adafruit myself.

The question I want to ask is whether it's important to preserve the current brightness setting. My recommendation is to replace the brightness logic with the 5-bit brightness yet present the same brightness range to the user through the API.

For example, store the brightness as a full range uint8_t but then scale down to the 5-bit brightness value and write that out with the leds during show(). This way anyone using the brightness feature would get an improvement in visual quality without having to change how they use the API.

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

1 participant