| 1032 | } |
| 1033 | |
| 1034 | void Fade(FastLED_NeoMatrix *matrix, int16_t x, int16_t y, EffectSettings *settings) |
| 1035 | { |
| 1036 | static uint8_t hue = 0; // Hue for the color of the 8 |
| 1037 | // Change the color of the 8 based on speed |
| 1038 | hue += settings->speed; |
| 1039 | // Draw the 8 with fading colors based on the palette |
| 1040 | |
| 1041 | for (int16_t i = 8 - 1; i >= 0; i--) |
| 1042 | { |
| 1043 | for (uint16_t j = 0; j < 32; j++) |
| 1044 | { |
| 1045 | CRGB color = ColorFromPalette(settings->palette, hue + (i * 256 / 8), 255, settings->blend ? LINEARBLEND : NOBLEND); |
| 1046 | matrix->drawPixel(x + j, y + i, color); |
| 1047 | } |
| 1048 | } |
| 1049 | } |
| 1050 | |
| 1051 | Effect effects[] = { |
| 1052 | {"Fade", Fade, EffectSettings(1, RainbowColors_p, true)}, |