(data, name, records, img_height, width)
return image
Draw an image of a list of standing record of each team.
        :return the image
Draw an image of a list of standing record of each team.
        :return the image
Draw an image of a list of standing record of each team . : return the image
def draw_standing(data, name, records, img_height, width):
    """
        Draw an image of a list of standing record of each team.
        :return the image
    """

    teams_info = data.teams_info
    layout = data.config.layout

    # Create a new data image.
    image = Image.new('RGB', (width, img_height))
    draw = ImageDraw.Draw(image)

    """
        Each record info is shown in a row of 7 pixel high. The initial row start at pixel 0 (top screen). For each
        team's record we add an other row and increment the row position by the height of a row plus the
        incrementation "i".
    """
    row_pos = 0
    row_height = 7
    top = row_height - 1  # For some reason, when drawing with PIL, the first row is not 0 but -1

    draw.text((1, 0), name, font=layout.font)
    row_pos += row_height

    for team in records:
        team_id = team['team_id']
        abbev = teams_info[team_id].abbreviation
        points = str(team['points'])
        wins = team['leagueRecord']['wins']
        losses = team['leagueRecord']['losses']
        ot = team['leagueRecord']['ot']
        team_colors = data.config.team_colors
        bg_color = team_colors.color("{}.primary".format(team_id))
        txt_color = team_colors.color("{}.text".format(team_id))
        draw.rectangle([0, top + row_pos, 12, row_pos], fill=(bg_color['r'], bg_color['g'], bg_color['b']))
        draw.text((1, row_pos), abbev, fill=(txt_color['r'], txt_color['g'], txt_color['b']), font=layout.font)
        if len(points) == 3:
            draw.text((54, row_pos), points, font=layout.font)
        else:
            draw.text((57, row_pos), points, font=layout.font)
        draw.text((19, row_pos), "{}-{}-{}".format(wins, losses, ot), font=layout.font)
        row_pos += row_height

    return image
def draw_standing ( data , name , records , img_height , width ) : teams_info = data . teams_info layout = data . config . layout # Create a new data image. image = Image . new ( 'RGB' , ( width , img_height ) ) draw = ImageDraw . Draw ( image ) """
        Each record info is shown in a row of 7 pixel high. The initial row start at pixel 0 (top screen). For each
        team's record we add an other row and increment the row position by the height of a row plus the
        incrementation "i".
    """ row_pos = 0 row_height = 7 top = row_height - 1 # For some reason, when drawing with PIL, the first row is not 0 but -1 draw . text ( ( 1 , 0 ) , name , font = layout . font ) row_pos += row_height for team in records : team_id = team [ 'team_id' ] abbev = teams_info [ team_id ] . abbreviation points = str ( team [ 'points' ] ) wins = team [ 'leagueRecord' ] [ 'wins' ] losses = team [ 'leagueRecord' ] [ 'losses' ] ot = team [ 'leagueRecord' ] [ 'ot' ] team_colors = data . config . team_colors bg_color = team_colors . color ( "{}.primary" . format ( team_id ) ) txt_color = team_colors . color ( "{}.text" . format ( team_id ) ) draw . rectangle ( [ 0 , top + row_pos , 12 , row_pos ] , fill = ( bg_color [ 'r' ] , bg_color [ 'g' ] , bg_color [ 'b' ] ) ) draw . text ( ( 1 , row_pos ) , abbev , fill = ( txt_color [ 'r' ] , txt_color [ 'g' ] , txt_color [ 'b' ] ) , font = layout . font ) if len ( points ) == 3 : draw . text ( ( 54 , row_pos ) , points , font = layout . font ) else : draw . text ( ( 57 , row_pos ) , points , font = layout . font ) draw . text ( ( 19 , row_pos ) , "{}-{}-{}" . format ( wins , losses , ot ) , font = layout . font ) row_pos += row_height return image