def update(self):
        """
        The function to draw a new frame for the particle system.
        """
        # Spawn new particles if required
        if 0 > self.time_left:
            self.time_left -= 1
            for _ in range(self._count):
                new_particle = self._new_particle()
                if new_particle is not None:
                    self.particles.append(new_particle)

        # Now draw them all
        for particle in self.particles:
            # Clear our the old particle
            last = particle.last()
            if last is not None:
                char, x, y, fg, attr, bg = last
                screen_data = self._screen.get_from(x, y)
                if self._blend and screen_data:
                    char2, fg2, attr2, bg2 = screen_data
                    index = 0
                    for i, colours in enumerate(particle.colours):
                        if (fg2, attr2, bg2) == colours:
                            index = i
                            break
                    index -= 1
                    fg, attr, bg = particle.colours[max(index, 0)]
                self._screen.print_at(" ", x, y, fg, attr, bg)

            if particle.time < particle.life_time:
                # Draw the new one
                char, x, y, fg, attr, bg = particle.next()
                screen_data = self._screen.get_from(x, y)
                if self._blend and screen_data:
                    char2, fg2, attr2, bg2 = screen_data
                    index = -1
                    for i, colours in enumerate(particle.colours):
                        if (fg2, attr2, bg2) == colours:
                            index = i
                            break
                    index += 1
                    fg, attr, bg = \
                        particle.colours[min(index, len(particle.colours) - 1)]
                self._screen.print_at(char, x, y, fg, attr, bg)
            else:
                self.particles.remove(particle)
dataset/ETHPy150Open peterbrittain/asciimatics/asciimatics/particles.py/ParticleEmitter.update/swapped operands of `>`