# Buggy code
def update_position(self, sprite: Sprite):
    """
    Called by the Sprite class to update position, angle, size and color
    of the specified sprite.
    Necessary for batch drawing of items.

    :param Sprite sprite: Sprite to update.
    """
    if self._vao1 is None:
        return

    i = self.sprite_idx[sprite]

    self._sprite_pos_data[i * 2] = sprite.position[0]
    self._sprite_pos_data[i * 2 + 1] = sprite.position[1]
    self._sprite_pos_changed = True

    self._sprite_angle_data[i] = math.radians(sprite.angle)
    self._sprite_angle_changed = True

    self._sprite_color_data[i * 4] = sprite.color[0]
    self._sprite_color_data[i * 4 + 1] = sprite.color[1]
    self._sprite_color_data[i * 4 + 2] = sprite.color[2]
    self._sprite_color_data[i * 4 + 3] = sprite.alpha
    self._sprite_color_changed = True


# Traceback (TypeError)
$ python -m arcade.examples.particle_fireworks
Traceback (most recent call last):
File "C:\Users\scott\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\scott\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\cache\repo\arcade\arcade\examples\particle_fireworks.py", line 357, in <module>
arcade.run()
File "C:\cache\repo\arcade\arcade\window_commands.py", line 246, in run
pyglet.app.run()
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\app\__init__.py", line 144, in run
event_loop.run()
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\app\base.py", line 175, in run
self._run()
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\app\base.py", line 187, in _run
timeout = self.idle()
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\app\base.py", line 314, in idle
window.dispatch_event('on_draw')
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\window\__init__.py", line 1330, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\event.py", line 428, in dispatch_event
self._raise_dispatch_exception(event_type, args, getattr(self, event_type), exception)
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\event.py", line 482, in _raise_dispatch_exception
raise exception
File "C:\cache\venv\arcadedev\lib\site-packages\pyglet\event.py", line 423, in dispatch_event
if getattr(self, event_type)(*args):
File "C:\cache\repo\arcade\arcade\examples\particle_fireworks.py", line 332, in on_draw
e.draw()
File "C:\cache\repo\arcade\arcade\emitter.py", line 167, in draw
self._particles.draw()
File "C:\cache\repo\arcade\arcade\sprite_list.py", line 803, in draw
self._calculate_sprite_buffer()
File "C:\cache\repo\arcade\arcade\sprite_list.py", line 619, in _calculate_sprite_buffer
calculate_colors()
File "C:\cache\repo\arcade\arcade\sprite_list.py", line 490, in calculate_colors
self._sprite_color_data.append(sprite.alpha)
TypeError: integer argument expected, got float
Error in sys.excepthook:

Original exception was:

# Fixed code
def update_position(self, sprite: Sprite):
    """
    Called by the Sprite class to update position, angle, size and color
    of the specified sprite.
    Necessary for batch drawing of items.

    :param Sprite sprite: Sprite to update.
    """
    if self._vao1 is None:
        return

    i = self.sprite_idx[sprite]

    self._sprite_pos_data[i * 2] = sprite.position[0]
    self._sprite_pos_data[i * 2 + 1] = sprite.position[1]
    self._sprite_pos_changed = True

    self._sprite_angle_data[i] = math.radians(sprite.angle)
    self._sprite_angle_changed = True

    self._sprite_color_data[i * 4] = int(sprite.color[0])
    self._sprite_color_data[i * 4 + 1] = int(sprite.color[1])
    self._sprite_color_data[i * 4 + 2] = int(sprite.color[2])
    self._sprite_color_data[i * 4 + 3] = int(sprite.alpha)
    self._sprite_color_changed = True