diff options
author | Mark Kriegsman <kriegsman@tr.org> | 2014-05-31 16:41:48 +0400 |
---|---|---|
committer | Mark Kriegsman <kriegsman@tr.org> | 2014-05-31 16:41:48 +0400 |
commit | 19bcc72623e7a28788f1dbd4307fb7a445029f79 (patch) | |
tree | f87aaf861d094b069a5e2b24cc53ac3d521ef965 /colorutils.h | |
parent | 7947112768eff495cafa5bcce92a29746257dd24 (diff) |
Added fill_gradient
Diffstat (limited to 'colorutils.h')
-rw-r--r-- | colorutils.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/colorutils.h b/colorutils.h index 457aec57..44b2855b 100644 --- a/colorutils.h +++ b/colorutils.h @@ -15,6 +15,29 @@ void fill_rainbow( struct CRGB * pFirstLED, int numToFill, uint8_t deltahue = 5); +// fill_gradient - fill a range of LEDs with a smooth gradient +// between two specified HSV colors. +// Since 'hue' is a value around a color wheel, +// there are always two ways to sweep from one hue +// to another. +// This function lets you specify which way you want +// the hue gradient to sweep around the color wheel: +// FORWARD_HUES: hue always goes clockwise +// BACKWARD_HUES: hue always goes counter-clockwise +// SHORTEST_HUES: hue goes whichever way is shortest +// LONGEST_HUES: hue goes whichever way is longest +// The default is SHORTEST_HUES, as this is nearly +// always what is wanted. +// +typedef enum { FORWARD_HUES, BACKWARD_HUES, SHORTEST_HUES, LONGEST_HUES } TGradientDirectionCode; + +void fill_gradient( struct CRGB* leds, + uint16_t startpos, CHSV startcolor, + uint16_t endpos, CHSV endcolor, + TGradientDirectionCode directionCode = SHORTEST_HUES ); + + + // fadeLightBy and fade_video - reduce the brightness of an array // of pixels all at once. Guaranteed // to never fade all the way to black. |