python-chess
python-chess copied to clipboard
feat: support rendering coordinates inside chessboard
Render coordinates inside the chessboard, left and bottom
chess.svg.board(board, inside_coordinates=True)
Render coordinates inside the chessboard, right and bottom
chess.svg.board(board, inside_coordinates=True, inside_coord_style=2)
chess.com board simulation
colors = {
'square light': '#EBECD0',
'square dark': '#739552',
}
chess.svg.board(board, inside_coordinates=True, colors=colors)
The following params are added for svg.board function:
inside_coordinates: PassTrueto enable render coordinates inside the board, this will override external coordinates if set to True. Default is False.inside_coord_color_light: Color for coordinates on light squares, default is to use dark square color.inside_coord_color_dark: Color for coordinates on dark squares, default is to use light square color.inside_coord_style: 1 for style1 (default), 2 for style2.- Style 1:
- The files labels are rendered in the bottom-right corner of each square in the bottom row of the chessboard.
- The ranks labels are rendered in the top-left corner of each squares in the left column of the chess board.
- Style 2:
- The files labels are rendered in the bottom-left corner of each square in the bottom row of the chessboard.
- The ranks labels are rendered in the top-right corner of each squares in the left column of the chess board.
- Style 1:
close #1145