FastLED 3.9.15
Loading...
Searching...
No Matches

◆ ChangePalettePeriodically()

void ChangePalettePeriodically ( )
Examples
ColorPalette.ino.

Definition at line 95 of file ColorPalette.ino.

96{
97 uint8_t secondHand = (millis() / 1000) % 60;
98 static uint8_t lastSecond = 99;
99
100 if( lastSecond != secondHand) {
101 lastSecond = secondHand;
102 if( secondHand == 0) { currentPalette = RainbowColors_p; currentBlending = LINEARBLEND; }
103 if( secondHand == 10) { currentPalette = RainbowStripeColors_p; currentBlending = NOBLEND; }
105 if( secondHand == 20) { SetupPurpleAndGreenPalette(); currentBlending = LINEARBLEND; }
106 if( secondHand == 25) { SetupTotallyRandomPalette(); currentBlending = LINEARBLEND; }
107 if( secondHand == 30) { SetupBlackAndWhiteStripedPalette(); currentBlending = NOBLEND; }
108 if( secondHand == 35) { SetupBlackAndWhiteStripedPalette(); currentBlending = LINEARBLEND; }
109 if( secondHand == 40) { currentPalette = CloudColors_p; currentBlending = LINEARBLEND; }
110 if( secondHand == 45) { currentPalette = PartyColors_p; currentBlending = LINEARBLEND; }
111 if( secondHand == 50) { currentPalette = myRedWhiteBluePalette_p; currentBlending = NOBLEND; }
113 }
114}
void SetupTotallyRandomPalette()
TBlendType currentBlending
const TProgmemPalette16 myRedWhiteBluePalette_p
CRGBPalette16 currentPalette
void SetupPurpleAndGreenPalette()
void SetupBlackAndWhiteStripedPalette()
@ NOBLEND
No interpolation between palette entries.
@ LINEARBLEND
Linear interpolation between palette entries, with wrap-around from end to the beginning again.
const TProgmemRGBPalette16 RainbowStripeColors_p
HSV Rainbow colors with alternatating stripes of black.
const TProgmemRGBPalette16 CloudColors_p
Cloudy color palette.
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
const TProgmemRGBPalette16 RainbowColors_p
HSV Rainbow.

References CloudColors_p, currentBlending, currentPalette, LINEARBLEND, myRedWhiteBluePalette_p, NOBLEND, PartyColors_p, RainbowColors_p, RainbowStripeColors_p, SetupBlackAndWhiteStripedPalette(), SetupPurpleAndGreenPalette(), and SetupTotallyRandomPalette().

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: