|
| 1 | +/* |
| 2 | + ESP32 FastLED WebServer: https://github.com/jasoncoon/esp32-fastled-webserver |
| 3 | + Copyright (C) 2017 Jason Coon |
| 4 | +
|
| 5 | + Built upon the amazing FastLED work of Daniel Garcia and Mark Kriegsman: |
| 6 | + https://github.com/FastLED/FastLED |
| 7 | +
|
| 8 | + ESP32 support provided by the hard work of Sam Guyer: |
| 9 | + https://github.com/samguyer/FastLED |
| 10 | +
|
| 11 | + This program is free software: you can redistribute it and/or modify |
| 12 | + it under the terms of the GNU General Public License as published by |
| 13 | + the Free Software Foundation, either version 3 of the License, or |
| 14 | + (at your option) any later version. |
| 15 | +
|
| 16 | + This program is distributed in the hope that it will be useful, |
| 17 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | + GNU General Public License for more details. |
| 20 | +
|
| 21 | + You should have received a copy of the GNU General Public License |
| 22 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | +*/ |
| 24 | + |
| 25 | +// A mostly red palette with green accents and white trim. |
| 26 | +// "CRGB::Gray" is used as white to keep the brightness more uniform. |
| 27 | +const TProgmemRGBPalette16 RedGreenWhite_p FL_PROGMEM = |
| 28 | +{ CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, |
| 29 | + CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, |
| 30 | + CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, |
| 31 | + CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green }; |
| 32 | + |
| 33 | +// A mostly (dark) green palette with red berries. |
| 34 | +#define Holly_Green 0x00580c |
| 35 | +#define Holly_Red 0xB00402 |
| 36 | +const TProgmemRGBPalette16 Holly_p FL_PROGMEM = |
| 37 | +{ Holly_Green, Holly_Green, Holly_Green, Holly_Green, |
| 38 | + Holly_Green, Holly_Green, Holly_Green, Holly_Green, |
| 39 | + Holly_Green, Holly_Green, Holly_Green, Holly_Green, |
| 40 | + Holly_Green, Holly_Green, Holly_Green, Holly_Red |
| 41 | +}; |
| 42 | + |
| 43 | +// A red and white striped palette |
| 44 | +// "CRGB::Gray" is used as white to keep the brightness more uniform. |
| 45 | +const TProgmemRGBPalette16 RedWhite_p FL_PROGMEM = |
| 46 | +{ CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, |
| 47 | + CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, |
| 48 | + CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, |
| 49 | + CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray }; |
| 50 | + |
| 51 | +// A mostly blue palette with white accents. |
| 52 | +// "CRGB::Gray" is used as white to keep the brightness more uniform. |
| 53 | +const TProgmemRGBPalette16 BlueWhite_p FL_PROGMEM = |
| 54 | +{ CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, |
| 55 | + CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, |
| 56 | + CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, |
| 57 | + CRGB::Blue, CRGB::Gray, CRGB::Gray, CRGB::Gray }; |
| 58 | + |
| 59 | +// A pure "fairy light" palette with some brightness variations |
| 60 | +#define HALFFAIRY ((CRGB::FairyLight & 0xFEFEFE) / 2) |
| 61 | +#define QUARTERFAIRY ((CRGB::FairyLight & 0xFCFCFC) / 4) |
| 62 | +const TProgmemRGBPalette16 FairyLight_p FL_PROGMEM = |
| 63 | +{ CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, |
| 64 | + HALFFAIRY, HALFFAIRY, CRGB::FairyLight, CRGB::FairyLight, |
| 65 | + QUARTERFAIRY, QUARTERFAIRY, CRGB::FairyLight, CRGB::FairyLight, |
| 66 | + CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight }; |
| 67 | + |
| 68 | +// A palette of soft snowflakes with the occasional bright one |
| 69 | +const TProgmemRGBPalette16 Snow_p FL_PROGMEM = |
| 70 | +{ 0x304048, 0x304048, 0x304048, 0x304048, |
| 71 | + 0x304048, 0x304048, 0x304048, 0x304048, |
| 72 | + 0x304048, 0x304048, 0x304048, 0x304048, |
| 73 | + 0x304048, 0x304048, 0x304048, 0xE0F0FF }; |
| 74 | + |
| 75 | +// A palette reminiscent of large 'old-school' C9-size tree lights |
| 76 | +// in the five classic colors: red, orange, green, blue, and white. |
| 77 | +#define C9_Red 0xB80400 |
| 78 | +#define C9_Orange 0x902C02 |
| 79 | +#define C9_Green 0x046002 |
| 80 | +#define C9_Blue 0x070758 |
| 81 | +#define C9_White 0x606820 |
| 82 | +const TProgmemRGBPalette16 RetroC9_p FL_PROGMEM = |
| 83 | +{ C9_Red, C9_Orange, C9_Red, C9_Orange, |
| 84 | + C9_Orange, C9_Red, C9_Orange, C9_Red, |
| 85 | + C9_Green, C9_Green, C9_Green, C9_Green, |
| 86 | + C9_Blue, C9_Blue, C9_Blue, |
| 87 | + C9_White |
| 88 | +}; |
| 89 | + |
| 90 | +// A cold, icy pale blue palette |
| 91 | +#define Ice_Blue1 0x0C1040 |
| 92 | +#define Ice_Blue2 0x182080 |
| 93 | +#define Ice_Blue3 0x5080C0 |
| 94 | +const TProgmemRGBPalette16 Ice_p FL_PROGMEM = |
| 95 | +{ |
| 96 | + Ice_Blue1, Ice_Blue1, Ice_Blue1, Ice_Blue1, |
| 97 | + Ice_Blue1, Ice_Blue1, Ice_Blue1, Ice_Blue1, |
| 98 | + Ice_Blue1, Ice_Blue1, Ice_Blue1, Ice_Blue1, |
| 99 | + Ice_Blue2, Ice_Blue2, Ice_Blue2, Ice_Blue3 |
| 100 | +}; |
| 101 | + |
| 102 | +const CRGBPalette16 palettes[] = { |
| 103 | + RainbowColors_p, |
| 104 | + RainbowStripeColors_p, |
| 105 | + CloudColors_p, |
| 106 | + LavaColors_p, |
| 107 | + OceanColors_p, |
| 108 | + ForestColors_p, |
| 109 | + PartyColors_p, |
| 110 | + HeatColors_p, |
| 111 | + Ice_p, |
| 112 | + Snow_p, |
| 113 | + RedWhite_p, |
| 114 | + BlueWhite_p, |
| 115 | + FairyLight_p, |
| 116 | + RetroC9_p, |
| 117 | + RedGreenWhite_p, |
| 118 | + Holly_p, |
| 119 | +}; |
| 120 | + |
| 121 | +const uint8_t paletteCount = ARRAY_SIZE(palettes); |
| 122 | + |
| 123 | +const String paletteNames[paletteCount] = { |
| 124 | + "Rainbow", |
| 125 | + "Rainbow Stripe", |
| 126 | + "Cloud", |
| 127 | + "Lava", |
| 128 | + "Ocean", |
| 129 | + "Forest", |
| 130 | + "Party", |
| 131 | + "Heat", |
| 132 | + "Ice", |
| 133 | + "Snow", |
| 134 | + "Red & White", |
| 135 | + "Blue & White", |
| 136 | + "Fairy", |
| 137 | + "Retro C9", |
| 138 | + "Red, Green & White", |
| 139 | + "Holly", |
| 140 | +}; |
0 commit comments