From b1b71920f088809f32293169eb143ec27347b3f9 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 6 May 2023 21:18:38 -0700 Subject: [PATCH] mask byte not nibble (#701) --- src/internal/features/NeoGrb48Feature.h | 6 +++--- src/internal/features/NeoRgb48Feature.h | 6 +++--- src/internal/features/NeoRgbw64Feature.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/internal/features/NeoGrb48Feature.h b/src/internal/features/NeoGrb48Feature.h index 644f430..5f08d88 100644 --- a/src/internal/features/NeoGrb48Feature.h +++ b/src/internal/features/NeoGrb48Feature.h @@ -35,11 +35,11 @@ public: // due to endianness the byte order must be copied to output *p++ = color.G >> 8; - *p++ = color.G & 0x0f; + *p++ = color.G & 0xff; *p++ = color.R >> 8; - *p++ = color.R & 0x0f; + *p++ = color.R & 0xff; *p++ = color.B >> 8; - *p = color.B & 0x0f; + *p = color.B & 0xff; } static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel) diff --git a/src/internal/features/NeoRgb48Feature.h b/src/internal/features/NeoRgb48Feature.h index e138962..d7386f7 100644 --- a/src/internal/features/NeoRgb48Feature.h +++ b/src/internal/features/NeoRgb48Feature.h @@ -35,11 +35,11 @@ public: // due to endianness the byte order must be copied to output *p++ = color.R >> 8; - *p++ = color.R & 0x0f; + *p++ = color.R & 0xff; *p++ = color.G >> 8; - *p++ = color.G & 0x0f; + *p++ = color.G & 0xff; *p++ = color.B >> 8; - *p = color.B & 0x0f; + *p = color.B & 0xff; } static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel) diff --git a/src/internal/features/NeoRgbw64Feature.h b/src/internal/features/NeoRgbw64Feature.h index f657773..892f45e 100644 --- a/src/internal/features/NeoRgbw64Feature.h +++ b/src/internal/features/NeoRgbw64Feature.h @@ -36,13 +36,13 @@ public: // due to endianness the byte order must be copied to output *p++ = color.R >> 8; - *p++ = color.R & 0x0f; + *p++ = color.R & 0xff; *p++ = color.G >> 8; - *p++ = color.G & 0x0f; + *p++ = color.G & 0xff; *p++ = color.B >> 8; - *p++ = color.B & 0x0f; + *p++ = color.B & 0xff; *p++ = color.W >> 8; - *p = color.W & 0x0f; + *p = color.W & 0xff; } static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel)