MCPcopy Create free account
hub / github.com/FastLED/FastLED / pacifica_add_whitecaps

Method pacifica_add_whitecaps

src/fl/fx/1d/pacifica.h:108–122  ·  view source on GitHub ↗

Add extra 'white' to areas where the four layers of light have lined up brightly

Source from the content-addressed store, hash-verified

106// Add extra 'white' to areas where the four layers of light have lined up
107// brightly
108void Pacifica::pacifica_add_whitecaps(fl::span<CRGB> leds) {
109 u8 basethreshold = beatsin8(9, 55, 65);
110 u8 wave = beat8(7);
111
112 for (u16 i = 0; i < mNumLeds; i++) {
113 u8 threshold = scale8(sin8(wave), 20) + basethreshold;
114 wave += 7;
115 u8 l = leds[i].getAverageLight();
116 if (l > threshold) {
117 u8 overage = l - threshold;
118 u8 overage2 = qadd8(overage, overage);
119 leds[i] += CRGB(overage, overage2, qadd8(overage2, overage2));
120 }
121 }
122}
123
124// Deepen the blues and greens
125void Pacifica::pacifica_deepen_colors(fl::span<CRGB> leds) {

Callers

nothing calls this directly

Calls 4

getAverageLightMethod · 0.80
scale8Function · 0.50
sin8Function · 0.50
CRGBClass · 0.50

Tested by

no test coverage detected