code: def rect(self, x, y, width, height, color, *, fill=False):
          
          # pylint: disable=too-many-arguments
          if self.rotation == 1:
              x, y = y, x
              width, height = height, width
              x = self.width - x - width
          if self.rotation == 2:
              x = self.width - x - width
              y = self.height - y - height
          if self.rotation == 3:
              x, y = y, x
              width, height = height, width
              y = self.height - y - height
  
          # pylint: disable=too-many-boolean-expressions
          if width < 1 or height < 1 or (x + width) <= 0 or (y + height) <= 0 or \
                  y >= self.height or x >= self.width:
              return
          x_end = min(self.width-1, x + width-1)
          y_end = min(self.height-1, y + height-1)
          x = max(x, 0)
          y = max(y, 0)
          if fill:
              self.format.fill_rect(self, x, y, x_end-x+1, y_end-y+1, color)
          else:
              self.format.fill_rect(self, x, y, x_end-x+1, 1, color)
              self.format.fill_rect(self, x, y, 1, y_end-y+1, color)
              self.format.fill_rect(self, x, y_end, x_end-x+1, 1, color)
              self.format.fill_rect(self, x_end, y, 1, y_end-y+1, color)
docs: Draw a rectangle at the given location, size and color. The ```rect``` method draws only
          a 1 pixel outline.