Skip to content

Commit 0629e14

Browse files
committed
Merge branch 'main' into multicolor_comet
# Conflicts: # adafruit_led_animation/animation/comet.py
2 parents 3aaa75e + b8538c6 commit 0629e14

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/release_gh.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
uses: adafruit/workflows-circuitpython-libs/release-gh@main
1717
with:
1818
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
upload-url: ${{ github.event.release.upload_url }}

adafruit_led_animation/animation/comet.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ class Comet(Animation):
3737
:param pixel_object: The initialised LED object.
3838
:param float speed: Animation speed in seconds, e.g. ``0.1``.
3939
:param color: Animation color in ``(r, g, b)`` tuple, or ``0x000000`` hex format.
40+
:param background_color: Background color in ``(r, g, b)`` tuple, or ``0x000000`` hex format.
41+
Defaults to BLACK.
4042
:param int tail_length: The length of the comet. Defaults to 25% of the length of the
4143
``pixel_object``. Automatically compensates for a minimum of 2 and a
4244
maximum of the length of the ``pixel_object``.
4345
:param bool reverse: Animates the comet in the reverse order. Defaults to ``False``.
44-
:param bool bounce: Comet will bounce back and forth. Defaults to ``True``.
46+
:param bool bounce: Comet will bounce back and forth. Defaults to ``False``.
4547
:param Optional[string] name: A human-readable name for the Animation.
4648
Used by the to string function.
4749
:param bool ring: Ring mode. Defaults to ``False``.
@@ -53,6 +55,7 @@ def __init__(
5355
pixel_object,
5456
speed,
5557
color,
58+
background_color=BLACK,
5659
tail_length=0,
5760
reverse=False,
5861
bounce=False,
@@ -70,6 +73,7 @@ def __init__(
7073
self._color_step = 0.95 / tail_length
7174
self._comet_colors = None
7275
self._computed_color = color
76+
self._background_color = background_color
7377
self._num_pixels = len(pixel_object)
7478
self._direction = -1 if reverse else 1
7579
self._left_side = -self._tail_length
@@ -84,7 +88,7 @@ def __init__(
8488
on_cycle_complete_supported = True
8589

8690
def _set_color(self, color):
87-
self._comet_colors = [BLACK]
91+
self._comet_colors = [self._background_color]
8892
for n in range(self._tail_length):
8993
self._comet_colors.append(
9094
calculate_intensity(color, n * self._color_step + 0.05)

adafruit_led_animation/animation/rainbowcomet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class RainbowComet(Comet):
4040
pixels present in the pixel object, e.g. if the strip is 30 pixels
4141
long, the ``tail_length`` cannot exceed 30 pixels.
4242
:param bool reverse: Animates the comet in the reverse order. Defaults to ``False``.
43-
:param bool bounce: Comet will bounce back and forth. Defaults to ``True``.
43+
:param bool bounce: Comet will bounce back and forth. Defaults to ``False``.
4444
:param int colorwheel_offset: Offset from start of colorwheel (0-255).
4545
:param int step: Colorwheel step (defaults to automatic).
4646
:param bool ring: Ring mode. Defaults to ``False``.
@@ -65,7 +65,7 @@ def __init__(
6565
self._colorwheel_step = step
6666
self._colorwheel_offset = colorwheel_offset
6767
super().__init__(
68-
pixel_object, speed, 0, tail_length, reverse, bounce, name, ring
68+
pixel_object, speed, 0, 0, tail_length, reverse, bounce, name, ring
6969
)
7070

7171
def _set_color(self, color):

0 commit comments

Comments
 (0)