def _set_color(self, color):
     self._comet_colors = [BLACK]
     for n in range(self._tail_length):
         self._comet_colors.append(
             calculate_intensity(color, n * self._color_step + 0.05)
         )
     self._computed_color = color
 def _set_color(self, color):
     self._comet_colors = [BLACK]
     for n in range(self._tail_length):
         invert = self._tail_length - n - 1
         self._comet_colors.append(
             calculate_intensity(
                 colorwheel(
                     int((invert * self._colorwheel_step) +
                         self._colorwheel_offset) % 256),
                 n * self._color_step + 0.05,
             ))
     self._computed_color = color
Пример #3
0
 def _generate_droplet(self, x, length):
     color = colorwheel(random.randint(0, 255))
     return [
         [n, calculate_intensity(color, 1.0 - -((n + 1) / (length + 1)))]
         for n in range(-length, 0)
     ]
Пример #4
0
 def _generate_droplet(self, x, length):
     return [
         [n, calculate_intensity(self.color, random.randint(10, 100) * 1.0)]
         for n in range(-length, 0)
     ]