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

◆ drawPlasmaWithPalette()

CRGB NoiseVariantManager::drawPlasmaWithPalette ( const RingCoord & coord,
uint32_t time_ms,
ColorPaletteManager & palette )
inlineprivate

Definition at line 500 of file FxNoiseRing.h.

500 {
501 // Generate base plasma waves
502 CRGB plasma_color = plasma_gen.calculatePlasmaPixel(coord, time_ms, plasma_params);
503
504 // Extract intensity and hue information from plasma
505 float intensity = (plasma_color.r + plasma_color.g + plasma_color.b) / 765.0f;
506
507 // Calculate wave interference for hue mapping
508 float time_scaled = time_ms * plasma_params.time_scale * 0.001f;
509 float wave_sum = 0.0f;
510
511 // Simplified wave calculation for hue determination
512 float dx = coord.x - 0.5f;
513 float dy = coord.y - 0.5f;
514 float distance = sqrt(dx*dx + dy*dy);
515 float wave_phase = distance * 2.0f + time_scaled * 1.5f;
516 wave_sum = sin(wave_phase);
517
518 float hue_norm = (wave_sum + 1.0f) * 0.5f; // Normalize to 0-1
519
520 // Use palette system for consistent color theming
521 return palette.mapColor(hue_norm, intensity, intensity > 0.8f ? 1.0f : 0.0f);
522 }
UINumberField palette("Palette", 0, 0, 2)
PlasmaParams plasma_params
PlasmaWaveGenerator plasma_gen

References palette(), plasma_gen, plasma_params, RingCoord::x, and RingCoord::y.

Referenced by renderVariant().

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