drivers icon indicating copy to clipboard operation
drivers copied to clipboard

RGB Leds and Brightness

Open directionless opened this issue 6 years ago • 2 comments
trafficstars

Modern RGB leds are amazingly bright. This often leads to wanting to set some global brightness level. I'm not sure if this is more desirable as something using the alpha channel, or as something that could be set for all leds.

I guess it's a bit lossy, since it would result in some floating point approximation. Still though, it seems valuable to me

directionless avatar May 07 '19 03:05 directionless

This could be done with a Luma calculation https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color but not sure that this would go in any particular driver. Seems to me like this would be some application specific code.

deadprogram avatar May 07 '19 14:05 deadprogram

Yes, I'm thinking the same. If the hardware has support for dimming we should use that in the driver, but otherwise leave it up to the application. Also see this package that I've started to write, inspired by FastLED: https://godoc.org/github.com/aykevl/ledsgo It would certainly be useful to have some way to dim LEDs, so far I've used (ledsgo.Color).Value which has worked well enough for me so far.

aykevl avatar May 07 '19 14:05 aykevl