From dfc3788b146d77059806cd24e66e7499693df7b9 Mon Sep 17 00:00:00 2001 From: Seth Troisi Date: Wed, 2 Jun 2021 19:00:17 -0700 Subject: Add scale8(uint8) --- src/pixeltypes.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pixeltypes.h b/src/pixeltypes.h index 6e91723d..addaafff 100644 --- a/src/pixeltypes.h +++ b/src/pixeltypes.h @@ -352,6 +352,14 @@ struct CRGB { return *this; } + /// return a CRGB object that is a scaled down version of this object + inline CRGB scale8 (uint8_t scaledown ) const + { + CRGB out = *this; + nscale8x3( out.r, out.g, out.b, scaledown); + return out; + } + /// return a CRGB object that is a scaled down version of this object inline CRGB scale8 (const CRGB & scaledown ) const { -- cgit v1.2.3