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

◆ mapWaveToColor()

CRGB PlasmaWaveGenerator::mapWaveToColor ( float wave_value,
const PlasmaParams & params )
inlineprivate

Definition at line 146 of file FxNoiseRing.h.

146 {
147 // Normalize wave to 0-1 range
148 float normalized = (wave_value + 4.0f) / 8.0f; // Assuming max amplitude ~4
149 normalized = constrain(normalized, 0.0f, 1.0f);
150
151 // Create flowing hue based on wave phase
152 uint8_t hue = (uint8_t)(normalized * 255.0f + params.hue_offset) % 256;
153
154 // Dynamic saturation based on wave intensity
155 float intensity = abs(wave_value);
156 uint8_t sat = (uint8_t)(192 + intensity * 63); // High saturation with variation
157
158 // Brightness modulation
159 uint8_t val = (uint8_t)(normalized * 255.0f * params.brightness);
160
161 return CHSV(hue, sat, val);
162 }
uint8_t hue
float brightness
Definition FxNoiseRing.h:97
uint8_t hue_offset
Definition FxNoiseRing.h:96

References PlasmaParams::brightness, hue, and PlasmaParams::hue_offset.

Referenced by calculatePlasmaPixel().

+ Here is the caller graph for this function: