Closed buggedcom closed 5 years ago
This can only be done during the initial configuration by using the led-brightness property. Otherwise you have to adjust pixel brightness yourself by changing the color.
by changing the color
You mean via sliding the colour towards black I guess?
Also, what version of node have you managed to get it working on? I've only managed to get everything to compile with 8.16
Yes, by changing the pixel color.
I am currently running node 11.15.0...
In case anyone else needs a function to slide the pixel to black you can use this as Color
is already imported by rpi-matrix
.
const black = Color.rgb(0, 0, 0);
function setLightPercentage(col, p) {
const black_level = (100 - p)/100;
const darkened = col.mix(black, black_level);
return darkened.rgb().object();
}
It's not perfect but does the job ok.
Thank you for this library.
Is there any way that you know of to set pixel brightness?