code: def line(self, x_0, y_0, x_1, y_1, color):
          # pylint: disable=too-many-arguments
          
          d_x = abs(x_1 - x_0)
          d_y = abs(y_1 - y_0)
          x, y = x_0, y_0
          s_x = -1 if x_0 > x_1 else 1
          s_y = -1 if y_0 > y_1 else 1
          if d_x > d_y:
              err = d_x / 2.0
              while x != x_1:
                  self.pixel(x, y, color)
                  err -= d_y
                  if err < 0:
                      y += s_y
                      err += d_x
                  x += s_x
          else:
              err = d_y / 2.0
              while y != y_1:
                  self.pixel(x, y, color)
                  err -= d_x
                  if err < 0:
                      x += s_x
                      err += d_y
                  y += s_y
          self.pixel(x, y, color)
docs: Bresenham's line algorithm