Fix getPixelColor.

This commit is contained in:
Blaz Kristan 2021-09-26 20:01:04 +02:00
parent 66132a912a
commit 8af953e20d

View File

@ -414,7 +414,12 @@ class BusNetwork : public Bus {
uint32_t getPixelColor(uint16_t pix) {
if (!_valid || pix >= _len) return 0;
uint16_t offset = pix*(_rgbw?4:3);
return ((_rgbw?(_data[offset+3] << 24):0) | (_data[offset] << 16) | (_data[offset+1] << 8) | (_data[offset+2]));
return (
(_rgbw ? (scale8(_data[offset+3], _bri) << 24) : 0)
| (scale8(_data[offset] , _bri) << 16)
| (scale8(_data[offset+1], _bri) << 8)
| (scale8(_data[offset+2], _bri) )
);
}
void show() {