draw_utils.py
def draw_shaded_frame(surf, x, y, width, height, shade_color=None, light_color=None, mode=0):
    """ draw a shaded frame (no middle)
        used to draw many controls
    """
    if shade_color is None:
        shade_color = COLOR_FOREGROUND_DARK
    if light_color is None:
        light_color = COLOR_FOREGROUND_LIGHT
    right = width + x
    bottom = height + y
    if mode & 1: 
        shade_color, light_color = light_color, shade_color
    pygame.draw.line(surf, light_color, (x+1, y), (right, y))
    pygame.draw.line(surf, darker(light_color, 0.1), (right, y), (right, bottom-1))
    pygame.draw.line(surf, shade_color, (x, bottom), (right-1, bottom))
    pygame.draw.line(surf, darker(shade_color, 0.1), (x, y+1), (x, bottom))

    if mode & 1:
        pygame.draw.line(surf, brighter(light_color, 0.25), (x, y), (x, y))
        pygame.draw.line(surf, brighter(light_color, 0.3), (right, bottom), (right, bottom))        
    else:
        pygame.draw.line(surf, darker(light_color, 0.25), (x, y), (x, y))
        pygame.draw.line(surf, darker(light_color, 0.3), (right, bottom), (right, bottom))
 draw a shaded frame (no middle)
        used to draw many controls
    
draw a shaded frame (no middle)
used to draw many controls
draw a shaded frame ( no middle ) used to draw many controls
def draw_shaded_frame(surf, x, y, width, height, shade_color=None, light_color=None, mode=0):
    if shade_color is None:
        shade_color = COLOR_FOREGROUND_DARK
    if light_color is None:
        light_color = COLOR_FOREGROUND_LIGHT
    right = width + x
    bottom = height + y
    if mode & 1: 
        shade_color, light_color = light_color, shade_color
    pygame.draw.line(surf, light_color, (x+1, y), (right, y))
    pygame.draw.line(surf, darker(light_color, 0.1), (right, y), (right, bottom-1))
    pygame.draw.line(surf, shade_color, (x, bottom), (right-1, bottom))
    pygame.draw.line(surf, darker(shade_color, 0.1), (x, y+1), (x, bottom))
    if mode & 1:
        pygame.draw.line(surf, brighter(light_color, 0.25), (x, y), (x, y))
        pygame.draw.line(surf, brighter(light_color, 0.3), (right, bottom), (right, bottom))        
    else:
        pygame.draw.line(surf, darker(light_color, 0.25), (x, y), (x, y))
        pygame.draw.line(surf, darker(light_color, 0.3), (right, bottom), (right, bottom))
def draw_shaded_frame ( surf , x , y , width , height , shade_color = None , light_color = None , mode = 0 ) : if shade_color is None : shade_color = COLOR_FOREGROUND_DARK if light_color is None : light_color = COLOR_FOREGROUND_LIGHT right = width + x bottom = height + y if mode & 1 : shade_color , light_color = light_color , shade_color pygame . draw . line ( surf , light_color , ( x + 1 , y ) , ( right , y ) ) pygame . draw . line ( surf , darker ( light_color , 0.1 ) , ( right , y ) , ( right , bottom - 1 ) ) pygame . draw . line ( surf , shade_color , ( x , bottom ) , ( right - 1 , bottom ) ) pygame . draw . line ( surf , darker ( shade_color , 0.1 ) , ( x , y + 1 ) , ( x , bottom ) ) if mode & 1 : pygame . draw . line ( surf , brighter ( light_color , 0.25 ) , ( x , y ) , ( x , y ) ) pygame . draw . line ( surf , brighter ( light_color , 0.3 ) , ( right , bottom ) , ( right , bottom ) ) else : pygame . draw . line ( surf , darker ( light_color , 0.25 ) , ( x , y ) , ( x , y ) ) pygame . draw . line ( surf , darker ( light_color , 0.3 ) , ( right , bottom ) , ( right , bottom ) )
draw a shaded frame (no middle)
used to draw many controls
draw a shaded frame ( no middle ) used to draw many controls
""" draw a shaded frame (no middle)
        used to draw many controls
    """
surf
x
y
width
height
shade_color
light_color
mode