Skip to content

Commit 6b6285b

Browse files
committed
Added DECLARE_GRADIENT_PALETTE, and Rainbow_gp definition just for completeness.
1 parent 8edbcaf commit 6b6285b

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

colorpalettes.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,21 @@ extern const TProgmemRGBPalette16 HeatColors_p FL_PROGMEM =
154154
0xFFFF33, 0xFFFF66, 0xFFFF99, 0xFFFFCC, 0xFFFFFF
155155
};
156156

157+
158+
// Gradient palette "Rainbow_gp",
159+
// provided for situations where you're going
160+
// to use a number of other gradient palettes, AND
161+
// you want a 'standard' FastLED rainbow as well.
162+
163+
DEFINE_GRADIENT_PALETTE( Rainbow_gp ) {
164+
0, 255, 0, 0, // Red
165+
32, 171, 85, 0, // Orange
166+
64, 171,171, 0, // Yellow
167+
96, 0,255, 0, // Green
168+
128, 0,171, 85, // Aqua
169+
160, 0, 0,255, // Blue
170+
192, 85, 0,171, // Purple
171+
224, 171, 0, 85, // Pink
172+
255, 255, 0, 0};// and back to Red
173+
157174
#endif

colorpalettes.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ extern const TProgmemRGBPalette16 PartyColors_p FL_PROGMEM;
4343
/// 'wrapping around' from the hot end to the cold end,
4444
/// which looks wrong.
4545
extern const TProgmemRGBPalette16 HeatColors_p FL_PROGMEM;
46-
46+
47+
48+
DECLARE_GRADIENT_PALETTE( Rainbow_gp);
49+
4750
FASTLED_NAMESPACE_END
4851

4952
///@}

colorutils.h

+3
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,9 @@ void nblendPaletteTowardPalette( CRGBPalette16& currentPalette,
11281128
#define DEFINE_GRADIENT_PALETTE(X) \
11291129
extern const TProgmemRGBGradientPalette_byte X[] FL_PROGMEM =
11301130

1131+
#define DECLARE_GRADIENT_PALETTE(X) \
1132+
extern const TProgmemRGBGradientPalette_byte X[] FL_PROGMEM
1133+
11311134

11321135
// Functions to apply gamma adjustments, either:
11331136
// - a single gamma adjustment to a single scalar value,

0 commit comments

Comments
 (0)