Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <danielgarcia@gmail.com>2015-09-14 22:32:06 +0300
committerDaniel Garcia <danielgarcia@gmail.com>2015-09-14 22:32:06 +0300
commitbaf0cbb28c5996b9c68e21ca0543859c3c57d883 (patch)
tree72f2094fbca1fe5cc1fda63d9f57f7c46d79d962 /pixeltypes.h
parentb3e1d2645f466040d51f32f299e609bec574437e (diff)
adding another scale function to CRGB
Diffstat (limited to 'pixeltypes.h')
-rw-r--r--pixeltypes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/pixeltypes.h b/pixeltypes.h
index 530cf0a0..206eeb1c 100644
--- a/pixeltypes.h
+++ b/pixeltypes.h
@@ -361,6 +361,15 @@ struct CRGB {
return *this;
}
+ inline CRGB scale8 (const CRGB & scaledown )
+ {
+ CRGB out;
+ out.r = scale8(r, scaledown.r);
+ out.g = scale8(g, scaledown.g);
+ out.b = scale8(b, scaledown.b);
+ return out;
+ }
+
// fadeToBlackBy is a synonym for nscale8( ..., 255-fadefactor)
inline CRGB& fadeToBlackBy (uint8_t fadefactor )
{