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:
authorMark Kriegsman <kriegsman@tr.org>2014-05-31 16:41:48 +0400
committerMark Kriegsman <kriegsman@tr.org>2014-05-31 16:41:48 +0400
commit19bcc72623e7a28788f1dbd4307fb7a445029f79 (patch)
treef87aaf861d094b069a5e2b24cc53ac3d521ef965 /colorutils.h
parent7947112768eff495cafa5bcce92a29746257dd24 (diff)
Added fill_gradient
Diffstat (limited to 'colorutils.h')
-rw-r--r--colorutils.h23
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.