mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-04 03:14:26 +02:00
Dirty on Luminance change (#727)
This commit is contained in:
@@ -74,11 +74,18 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
uint8_t _luminance;
|
uint8_t _luminance;
|
||||||
|
|
||||||
void setLuminance(uint8_t luminance)
|
bool setLuminance(uint8_t luminance)
|
||||||
|
{
|
||||||
|
bool different = (_luminance != luminance);
|
||||||
|
|
||||||
|
if (different)
|
||||||
{
|
{
|
||||||
_luminance = luminance;
|
_luminance = luminance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return different;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t getLuminance() const
|
uint8_t getLuminance() const
|
||||||
{
|
{
|
||||||
return _luminance;
|
return _luminance;
|
||||||
@@ -135,7 +142,10 @@ public:
|
|||||||
// does NOT affect current pixel data as there is no safe way
|
// does NOT affect current pixel data as there is no safe way
|
||||||
// to reconstruct the original color values after being
|
// to reconstruct the original color values after being
|
||||||
// modified with both luminance and gamma without storing them
|
// modified with both luminance and gamma without storing them
|
||||||
Shader.setLuminance(luminance);
|
if (Shader.setLuminance(luminance))
|
||||||
|
{
|
||||||
|
this->Dirty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t GetLuminance() const
|
uint8_t GetLuminance() const
|
||||||
|
Reference in New Issue
Block a user