20 float progress = float( x /
float( _p->
matrix_width + 4 ) );
23 uint16_t index = _p->
xy( x, y );
31 static float iter = 0;
34 float progress = float( x /
float( _p->
matrix_width + 4 ) );
35 CRGB col = ColorFromPalette( _p->
current_palette, progress*255 + iter );
37 uint16_t index = _p->
xy( x, y );
60 float progress = float( x /
float( _p->
matrix_width + 4 ) );
62 if( random8() <= 32 ){
63 uint16_t index = _p->
xy( x, y );
73 center_position *= sway_width;
76 float progress = float( x /
float( _p->
matrix_width + 4 ) );
77 float palette_index = ( progress*255 ) + center_position;
79 if( palette_index < 0 ){
82 else if( palette_index > 255 ){
86 CRGB col = ColorFromPalette( _p->
current_palette, uint8_t(palette_index) );
88 uint16_t index = _p->
xy( x, y );
95 float center_position = beatsin8(60)-128;
101 float center_position = beatsin8(60)-128;
107 const uint8_t gradient[] = {
108 0, col1.r, col1.g, col1.b,
109 255, col2.r, col2.g, col2.b
112 pal.loadDynamicGradientPalette(gradient);
118 const uint8_t gradient[] = {
119 0, col1.r, col1.g, col1.b,
120 127, col2.r, col2.g, col2.b,
121 255, col3.r, col3.g, col3.b
124 pal.loadDynamicGradientPalette(gradient);
130 const uint8_t gradient[] = {
131 0, col1.r, col1.g, col1.b,
132 85, col2.r, col2.g, col2.b,
133 170, col3.r, col3.g, col3.b,
134 255, col4.r, col4.g, col4.b
137 pal.loadDynamicGradientPalette(gradient);
142CRGBPalette16
make_gradient(CRGB col1, CRGB col2, CRGB col3, CRGB col4, CRGB col5){
143 const uint8_t gradient[] = {
144 0, col1.r, col1.g, col1.b,
145 63, col2.r, col2.g, col2.b,
146 127, col3.r, col3.g, col3.b,
147 191, col4.r, col4.g, col4.b,
148 255, col5.r, col5.g, col5.b
151 pal.loadDynamicGradientPalette(gradient);
156CRGBPalette16
make_gradient(CRGB col1, CRGB col2, CRGB col3, CRGB col4, CRGB col5, CRGB col6){
157 const uint8_t gradient[] = {
158 0, col1.r, col1.g, col1.b,
159 51, col2.r, col2.g, col2.b,
160 102, col3.r, col3.g, col3.b,
161 153, col4.r, col4.g, col4.b,
162 204, col5.r, col5.g, col5.b,
163 255, col6.r, col6.g, col6.b
166 pal.loadDynamicGradientPalette(gradient);
171CRGBPalette16
make_gradient(CRGB col1, CRGB col2, CRGB col3, CRGB col4, CRGB col5, CRGB col6, CRGB col7){
172 const uint8_t gradient[] = {
173 0, col1.r, col1.g, col1.b,
174 42, col2.r, col2.g, col2.b,
175 84, col3.r, col3.g, col3.b,
176 126, col4.r, col4.g, col4.b,
177 168, col5.r, col5.g, col5.b,
178 210, col6.r, col6.g, col6.b,
179 255, col7.r, col7.g, col7.b
182 pal.loadDynamicGradientPalette(gradient);
187CRGBPalette16
make_gradient(CRGB col1, CRGB col2, CRGB col3, CRGB col4, CRGB col5, CRGB col6, CRGB col7, CRGB col8){
188 const uint8_t gradient[] = {
189 0, col1.r, col1.g, col1.b,
190 36, col2.r, col2.g, col2.b,
191 72, col3.r, col3.g, col3.b,
192 108, col4.r, col4.g, col4.b,
193 144, col5.r, col5.g, col5.b,
194 180, col6.r, col6.g, col6.b,
195 216, col7.r, col7.g, col7.b,
196 255, col8.r, col8.g, col8.b
199 pal.loadDynamicGradientPalette(gradient);
This is the software documentation for using Pixie Chroma functions on Arduino! For full example usag...
float animation_speed
Used by animation functions to scale the apparent speed of animation.
CRGB * color_map
Contains the entire color map, including "invisible" areas.
uint16_t matrix_width
Stores the final width of the matrix, including invisible pixels.
CRGBPalette16 current_palette
The current FastLED CRGBPalette16 used for animations.
uint16_t xy(int32_t x, int32_t y, bool wrap=false)
This function returns the 1D color_map / mask index of a given 2D coordinate in the display matrix.
void color_dim(uint8_t amount)
Darkens the color buffer by an 8-bit amount.
uint16_t matrix_height
Stores the final height of the matrix, including invisible pixels.
void _PENDULUM(PixieChroma *_p, float center_position, float sway_width)
Internal animation that sways the current color palette left and right with a sine function at 1Hz in...
CRGBPalette16 make_gradient(CRGB col1, CRGB col2)
Converts a set of CRGB colors to a gradient, and creates a color palette from that gradient.
void ANIMATION_PALETTE_SHIFT_RIGHT(PixieChroma *_p, float delta)
Shows the current color palette, while constantly shifting it to the right.
void ANIMATION_STATIC(PixieChroma *_p, float delta)
Shows the current color palette without animation.
void ANIMATION_PALETTE_SHIFT_LEFT(PixieChroma *_p, float delta)
Shows the current color palette, while constantly shifting it to the left.
void ANIMATION_NULL(PixieChroma *_p, float delta)
It does nothing, but it does nothing REALLY WELL! You can enable this empty function with pix....
void ANIMATION_PENDULUM_WIDE(PixieChroma *_p, float delta)
Sways the current color palette left and right with a sine function at 1Hz intervals....
void ANIMATION_PENDULUM(PixieChroma *_p, float delta)
Sways the current color palette left and right with a sine function at 1Hz intervals.
void ANIMATION_GLITTER(PixieChroma *_p, float delta)
Shows the current color palette with a sparkling effect.
void _PALETTE_SHIFT(PixieChroma *_p, int8_t amount, float delta)
Internal animation, shifts the color palette a fixed amount on each run.