node-pixel icon indicating copy to clipboard operation
node-pixel copied to clipboard

LED brightness

Open josephclawrence opened this issue 8 years ago • 5 comments

Is there any way to control LED brightness in node-pixel, and if not is it potentially on the roadmap? Thank you!

josephclawrence avatar Oct 11 '17 18:10 josephclawrence

There's not a way that's baked into the code right now. The way I do it is to use the color library.

At the end of the day, all the firmware cares about is getting the right RGB value to display the pixel so really you want to be computing that on the node side.

So you can do this:

let color = Color('#7743CE');

color.lighten(0.5);

strip.color(color.string()); // strip will now be 50% lighter than original

Now NodePixel has correction in it this works fairly reliably.

ajfisher avatar Oct 11 '17 22:10 ajfisher

Would be very interested in having brightness control too. The method above with the color library works to an extent but the results are still not perfect.

scottsweb avatar Aug 27 '18 17:08 scottsweb

Actually I am seeing better results with color.darken, this may well be enough for now.

scottsweb avatar Aug 27 '18 17:08 scottsweb

Has there been any movement on this? It would be really useful to set a color value and change just brightness values, similar to the way that FastLED utilizes HSV.

che-effe avatar Dec 17 '18 18:12 che-effe

PRs for this definitely accepted. As you can use HSV on the color side it should just be a case of converting and then bumping the brightness up or down

On Tue, Dec 18, 2018, 05:51 Charles F [email protected] wrote:

Has there been any movement on this? It would be really useful to set a color value and change just brightness values, similar to the way that FastLED utilizes HSV.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ajfisher/node-pixel/issues/111#issuecomment-447956282, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHRo5l7RJ1_z35X9341ZNDnOfM7ByDFks5u5-e7gaJpZM4P17PG .

ajfisher avatar Dec 17 '18 19:12 ajfisher