This commit is contained in:
Michael Miller authored and GitHub committed 2019-12-04 13:09:26 -08:00
1 parent d71ad7a1fa
commit 2f63405c5c
5 files changed
+29

No files matched your search

+6
View File
@@ -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)