def draw(self):
    if self.in_click:
        if (self.click_loss_time < pygame.time.get_ticks()):
            self.in_click = False
    if (not self._visible):
        return
    if self.in_click:
        (r, g, b) = self.bg_color
        k = 0.95
        self.surface.fill(((r * k), (g * k), (b * k)))
    else:
        self.surface.fill(self.bg_color)
    if self.is_hover:
        pygame.draw.rect(self.surface, (0, 0, 0), (0, 0, self.width, self.height), 1)
        pygame.draw.rect(self.surface, (100, 100, 100), (0, 0, (self.width - 1), (self.height - 1)), 1)
        layers = 5
        r_step = ((210 - 170) / layers)
        g_step = ((225 - 205) / layers)
        for i in range(layers):
            pygame.draw.rect(self.surface, ((170 + (r_step * i)), (205 + (g_step * i)), 255), (i, i, ((self.width - 2) - (i * 2)), ((self.height - 2) - (i * 2))), 1)
    else:
        self.surface.fill(self.bg_color)
        pygame.draw.rect(self.surface, (0, 0, 0), (0, 0, self.width, self.height), 1)
        pygame.draw.rect(self.surface, (100, 100, 100), (0, 0, (self.width - 1), (self.height - 1)), 1)
        pygame.draw.rect(self.surface, self.bg_color, (0, 0, (self.width - 2), (self.height - 2)), 1)
    self.surface.blit(self.textImage, (self._tx, self._ty))
def draw(self):
    if self.in_click:
        if (self.click_loss_time < pygame.time.get_ticks()):
            self.in_click = False
    if (not self._visible):
        return
    if self.in_click:
        (r, g, b) = self.bg_color
        k = 0.95
        self.surface.fill(((r * k), (g * k), (b * k)))
    else:
        self.surface.fill(self.bg_color)
    if self.is_hover:
        pygame.draw.rect(self.surface, (0, 0, 0), (0, 0, self.width, self.height), 1)
        pygame.draw.rect(self.surface, (100, 100, 100), (0, 0, (self.width - 1), (self.height - 1)), 1)
        layers = 5
        r_step = ((210 - 170) / layers)
        g_step = ((225 - 205) / layers)
        for i in range(layers):
            pygame.draw.rect(self.surface, ((170 + (r_step * i)), (205 + (g_step * i)), 255), (i, i, ((self.width - 2) - (i * 2)), ((self.height - 2) - (i * 2))), 1)
    else:
        self.surface.fill(self.bg_color)
        pygame.draw.rect(self.surface, (0, 0, 0), (0, 0, self.width, self.height), 1)
        pygame.draw.rect(self.surface, (100, 100, 100), (0, 0, (self.width - 1), (self.height - 1)), 1)
        pygame.draw.rect(self.surface, self.bg_color, (0, 0, (self.width - 2), (self.height - 2)), 1)
    self.surface.blit(self.textImage, (self._tx, self._ty))