Glühwürmchen: gelb bis orange statt grünlich-gelb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
44164e42a4
commit
b0dbd20014
1 file changed
+4
-2
+4
-2
@@ -88,11 +88,12 @@ void renderOcean(uint32_t now) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Glühwürmchen: grünlich-gelbe Lichter blinken langsam im Dunkeln -----------
|
// --- Glühwürmchen: gelbe bis orange Lichter blinken langsam im Dunkeln --------
|
||||||
|
|
||||||
struct Firefly {
|
struct Firefly {
|
||||||
float p[3], v[3];
|
float p[3], v[3];
|
||||||
uint32_t start; // Beginn des nächsten Leuchtens
|
uint32_t start; // Beginn des nächsten Leuchtens
|
||||||
|
uint8_t green; // Grünanteil: wenig = orange, viel = gelb
|
||||||
};
|
};
|
||||||
static Firefly flies[10];
|
static Firefly flies[10];
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ void renderFireflies(uint32_t now) {
|
|||||||
f.v[i] = 0;
|
f.v[i] = 0;
|
||||||
}
|
}
|
||||||
f.start = now + random16(3000);
|
f.start = now + random16(3000);
|
||||||
|
f.green = random8(60, 150);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FastLED.clear();
|
FastLED.clear();
|
||||||
@@ -121,7 +123,7 @@ void renderFireflies(uint32_t now) {
|
|||||||
if (t < 0) continue;
|
if (t < 0) continue;
|
||||||
float env = t < 400 ? t / 400.0f : t < 700 ? 1 : t < 1500 ? 1 - (t - 700) / 800.0f : 0;
|
float env = t < 400 ? t / 400.0f : t < 700 ? 1 : t < 1500 ? 1 - (t - 700) / 800.0f : 0;
|
||||||
if (t >= 1500) f.start = now + random16(1000, 4000);
|
if (t >= 1500) f.start = now + random16(1000, 4000);
|
||||||
if (env > 0) plotSoft(f.p[0], f.p[1], f.p[2], CRGB(scale8(highlight, 150), highlight, 0).nscale8(uint8_t(env * 255)));
|
if (env > 0) plotSoft(f.p[0], f.p[1], f.p[2], CRGB(highlight, scale8(highlight, f.green), 0).nscale8(uint8_t(env * 255)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user