feat(patterns): reverse animation direction via preset n8
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
55a97ac51c
commit
94266d5a7c
11 files changed
+131
-62
No files matched your search
@@ -26,13 +26,13 @@ class Aurora:
|
||||
c = self.driver.apply_brightness(colors[idx], preset.b)
|
||||
w = 255 - abs(128 - ((i * 8 + phase) & 255)) * 2
|
||||
w = max(0, min(255, w + shimmer))
|
||||
self.driver.n[i] = (
|
||||
self.driver.n[self.driver.led_i(preset, i)] = (
|
||||
(c[0] * w) // 255,
|
||||
(c[1] * w) // 255,
|
||||
(c[2] * w) // 255,
|
||||
)
|
||||
self.driver.n.write()
|
||||
phase = (phase + 1) & 255
|
||||
phase = (phase + self.driver.signed(preset, 1)) & 255
|
||||
self.driver.step = phase
|
||||
last = utime.ticks_add(last, d)
|
||||
if not preset.a:
|
||||
@@ -76,9 +76,9 @@ class Aurora:
|
||||
peak = lerp3(colors[fi], colors[fi + 1], frac)
|
||||
peak = self.driver.apply_brightness(peak, preset.b)
|
||||
mixf = min(255, int(w * contrast * 2) >> 1)
|
||||
self.driver.n[i] = lerp3(bg, peak, mixf)
|
||||
self.driver.n[self.driver.led_i(preset, i)] = lerp3(bg, peak, mixf)
|
||||
self.driver.n.write()
|
||||
phase = (phase + drift) % 256
|
||||
phase = (phase + self.driver.signed(preset, drift)) % 256
|
||||
last = utime.ticks_add(last, d)
|
||||
if not preset.a:
|
||||
yield
|
||||
|
||||
Reference in new issue
Block a user