def draw_line(self, _from: Point2D, to: Point2D): if (_from.is_empty()): return if self._load_image_flag is False: self.color.hsva = (interp(self.count, [0, self.number_of_lines], [0, 360]), 100, 100) else: self.color = tuple(self._image_pixels_color_array[int(to.y)][int( to.x)]) pygame.draw.line(self.canvas, self.color, _from.to_tuple(), to.to_tuple(), 2) self.count += 1
def preview(canvas, starting_edge: Point2D, ending_edge: Point2D): line(canvas, Obstacle.COLOR, starting_edge.to_tuple(), ending_edge.to_tuple(), 5)
def preview(self, canvas, mouse_position: Point2D): circle(canvas, self.COLOR, mouse_position.to_tuple(), 5)