diff --git a/src/NeoPixelBusLg.h b/src/NeoPixelBusLg.h index c27b0f8..9afaeee 100644 --- a/src/NeoPixelBusLg.h +++ b/src/NeoPixelBusLg.h @@ -74,9 +74,16 @@ public: protected: uint8_t _luminance; - void setLuminance(uint8_t luminance) + bool setLuminance(uint8_t luminance) { - _luminance = luminance; + bool different = (_luminance != luminance); + + if (different) + { + _luminance = luminance; + } + + return different; } uint8_t getLuminance() const @@ -135,7 +142,10 @@ public: // does NOT affect current pixel data as there is no safe way // to reconstruct the original color values after being // modified with both luminance and gamma without storing them - Shader.setLuminance(luminance); + if (Shader.setLuminance(luminance)) + { + this->Dirty(); + } } uint8_t GetLuminance() const