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

◆ drawLavaLamp()

CRGB drawLavaLamp ( const RingCoord & coord,
uint32_t time_ms,
ColorPaletteManager & palette )

Definition at line 281 of file FxNoiseRing.h.

281 {
282 float slow_time = time_ms * 0.0002f;
283
284 float blob_scale = 800;
285 uint16_t primary_noise = inoise16(coord.x * blob_scale, coord.y * blob_scale, slow_time * 1000);
286 uint16_t secondary_noise = inoise16(coord.x * blob_scale * 0.5f, coord.y * blob_scale * 0.5f, slow_time * 1500);
287
288 float blob_value = (primary_noise + secondary_noise * 0.3f) / 65536.0f;
289
290 if (blob_value > 0.6f) {
291 // Hot blob center
292 float intensity = (blob_value - 0.6f) / 0.4f;
293 return palette.mapColor(0.1f, intensity); // Warm colors
294 } else if (blob_value > 0.3f) {
295 // Blob edge gradient
296 float edge_factor = (blob_value - 0.3f) / 0.3f;
297 return palette.mapColor(0.2f, edge_factor);
298 } else {
299 // Background
300 return palette.mapColor(0.8f, 0.2f); // Cool background
301 }
302}
UINumberField palette("Palette", 0, 0, 2)
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z, uint32_t t)
16-bit, fixed point implementation of Perlin's noise.
Definition noise.cpp:420

References inoise16(), palette(), RingCoord::x, and RingCoord::y.

Referenced by NoiseVariantManager::renderVariant().

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