mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-03 19:04:26 +02:00
Dirty on Luminance change (#727)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user