Beispiel #1
0
 def color_function(self, x, y):
     distance = math.sqrt((self.start_x-x)*(self.start_x-x)+(self.start_y-y)*(self.start_y-y))
     if graphics.fill_rainbow():
         return graphics.rainbow_colors[int(distance*0.5 / graphics.user_line_size % len(graphics.rainbow_colors))]
     if distance % (graphics.user_line_size*2) < graphics.user_line_size: return graphics.get_fill_color()
     if graphics.line_rainbow():
         return graphics.rainbow_colors[(int((x+y)/10)) % len(graphics.rainbow_colors)]
     return graphics.get_line_color()
Beispiel #2
0
 def color_function(self, x, y):
     denom = int(graphics.user_line_size)*2
     if (x/denom + y/denom) % 2 == 0:
         if graphics.fill_rainbow():
             return graphics.rainbow_colors[(int(x/denom)+int(y/denom)) % len(graphics.rainbow_colors)]
         return graphics.get_fill_color()
     if graphics.line_rainbow():
         return graphics.rainbow_colors[(int(x/denom)+int(y/denom)) % len(graphics.rainbow_colors)]
     return graphics.get_line_color()