mirror of
https://github.com/wled/WLED.git
synced 2025-07-19 16:56:35 +00:00
Fix getPixelColor.
This commit is contained in:
parent
66132a912a
commit
8af953e20d
@ -414,7 +414,12 @@ class BusNetwork : public Bus {
|
|||||||
uint32_t getPixelColor(uint16_t pix) {
|
uint32_t getPixelColor(uint16_t pix) {
|
||||||
if (!_valid || pix >= _len) return 0;
|
if (!_valid || pix >= _len) return 0;
|
||||||
uint16_t offset = pix*(_rgbw?4:3);
|
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() {
|
void show() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user