Exemple #1
0
    def render(self, img):
        c = COLORS[self.color]

        # Background color
        fill_coords(img, point_in_rect(0, 1, 0, 1), c)

        # Little waves
        for i in range(3):
            ylo = 0.3 + 0.2 * i
            yhi = 0.4 + 0.2 * i
            fill_coords(img, point_in_line(0.1, ylo, 0.3, yhi, r=0.03),
                        (0, 0, 0))
            fill_coords(img, point_in_line(0.3, yhi, 0.5, ylo, r=0.03),
                        (0, 0, 0))
            fill_coords(img, point_in_line(0.5, ylo, 0.7, yhi, r=0.03),
                        (0, 0, 0))
            fill_coords(img, point_in_line(0.7, yhi, 0.9, ylo, r=0.03),
                        (0, 0, 0))
  def render(self, img):
    orange = (255, 128, 0)

    # Background color
    rendering.fill_coords(img, rendering.point_in_rect(0, 1, 0, 1), orange)

    # Little waves
    for i in range(3):
      ylo = 0.3 + 0.2 * i
      yhi = 0.4 + 0.2 * i
      rendering.fill_coords(
          img, rendering.point_in_line(0.1, ylo, 0.3, yhi, r=0.03), (0, 0, 0))
      rendering.fill_coords(
          img, rendering.point_in_line(0.3, yhi, 0.5, ylo, r=0.03), (0, 0, 0))
      rendering.fill_coords(
          img, rendering.point_in_line(0.5, ylo, 0.7, yhi, r=0.03), (0, 0, 0))
      rendering.fill_coords(
          img, rendering.point_in_line(0.7, yhi, 0.9, ylo, r=0.03), (0, 0, 0))