diff options
author | Mark Kriegsman <1334634+kriegsman@users.noreply.github.com> | 2021-07-18 19:50:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-18 19:50:02 +0300 |
commit | a245d5168351e6a8209eb06d37081c48df590c1b (patch) | |
tree | a076c91bf6637027a4dc11a3e8c5e242e99594fc | |
parent | e5921775c64c2eb3428e70f9f39ebd7d76f51b5e (diff) | |
parent | dfc3788b146d77059806cd24e66e7499693df7b9 (diff) |
Merge pull request #1245 from sethtroisi/new_scale
Add scale8(uint8) -- which may cause a behavior change if a uint32_t was being passed in, but this is definitely a 'fix'.
-rw-r--r-- | src/pixeltypes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pixeltypes.h b/src/pixeltypes.h index 6e91723d..addaafff 100644 --- a/src/pixeltypes.h +++ b/src/pixeltypes.h @@ -353,6 +353,14 @@ struct CRGB { } /// 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 { CRGB out; |