forked from Makuna/NeoPixelBus
Dim (#312)
This commit is contained in:
1 parent
d71ad7a1fa
commit
2f63405c5c
5 files changed
+29
No files matched your search
@@ -67,6 +67,12 @@ uint8_t RgbwColor::CalculateBrightness() const
|
||||
}
|
||||
}
|
||||
|
||||
RgbwColor RgbwColor::Dim(uint8_t ratio) const
|
||||
{
|
||||
// specifically avoids float math
|
||||
return RgbwColor(R * ratio / 255, G * ratio / 255, B * ratio / 255, W * ratio / 255);
|
||||
}
|
||||
|
||||
void RgbwColor::Darken(uint8_t delta)
|
||||
{
|
||||
if (R > delta)
|
||||
|
||||
Reference in new issue
Block a user