Raspberry Pi + neopixel:如果降低RGB LED的亮度,是否表示无法渲染某些颜色?

Referring to the python library neopixel (rpi_ws281x), to control WS2812B RGB LED strips, does trimming the brightness by scaling the byte for each sub-LED in a pixel from 255 to 127 limits us from rendering certain colors?


def setBrightness(self, brightness):
        """Scale each LED in the buffer by the provided brightness.  A brightness
        of 0 is the darkest and 255 is the brightest.
        ws.ws2811_channel_t_brightness_set(self._channel, brightness)



谁能解释该库中的亮度控制/调光功能如何工作? 它不应该降低PWM占空比以降低亮度(功率)吗?



The color values are not clipped, but multiplied by the brightness factor. So 255 turns into 127, 127 into 63.

The color (255, 187, 120) would then become (127, 93, 60).


A CCT of 3200K, which would be defined as (255, 187, 120), would still be 3200K at (127, 93, 60), since the relation between the colors stays the same. If you had LEDs with a higher dynamic range, 3200K could be defined as (1023, 375, 239).

But one thing to notice is that brightness is not a linear function in these LEDs. Usually the brightness jump from 0 to 16 is much more noticeable than the one from 111 to 127, so yes, in that sense you will lose colors. You would have more accurate colors by putting a black textile over the LED which let's only through 50% of the light.