Skip to content

Commit ba82d84

Browse files
authored
Merge pull request #17 from adafruit/black-update
Black reformatting with Python 3 target.
2 parents 64a365a + 91c84f0 commit ba82d84

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

adafruit_led_animation/animation.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def draw(self):
386386
self.fill(color)
387387
self.show()
388388

389+
389390
class SparklePulse(Animation):
390391
"""
391392
Combination of the Spark and Pulse animations.
@@ -399,7 +400,9 @@ class SparklePulse(Animation):
399400
"""
400401

401402
# pylint: disable=too-many-arguments
402-
def __init__(self, pixel_object, speed, color, period=5, max_intensity=1, min_intensity=0):
403+
def __init__(
404+
self, pixel_object, speed, color, period=5, max_intensity=1, min_intensity=0
405+
):
403406
if len(pixel_object) < 2:
404407
raise ValueError("Sparkle needs at least 2 pixels")
405408
self.max_intensity = max_intensity
@@ -432,14 +435,19 @@ def draw(self):
432435
now = monotonic_ns()
433436
time_since_last_draw = (now - self._last_update) / NANOS_PER_SECOND
434437
self._last_update = now
435-
pos = self._cycle_position = (self._cycle_position + time_since_last_draw) % self._period
438+
pos = self._cycle_position = (
439+
self._cycle_position + time_since_last_draw
440+
) % self._period
436441
if pos > self._half_period:
437442
pos = self._period - pos
438-
intensity = self.min_intensity + (pos * self._intensity_delta * self._position_factor)
443+
intensity = self.min_intensity + (
444+
pos * self._intensity_delta * self._position_factor
445+
)
439446
color = [int(self.color[n] * intensity) for n in range(self._bpp)]
440447
self.pixel_object[pixel] = color
441448
self.show()
442449

450+
443451
class Chase(Animation):
444452
"""
445453
Chase pixels in one direction in a single color, like a theater marquee sign.

0 commit comments

Comments
 (0)