Skip to content

feat: support rendering coordinates inside chessboard #1147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

plutotree
Copy link

Render coordinates inside the chessboard, left and bottom
chess.svg.board(board, inside_coordinates=True)

r1

Render coordinates inside the chessboard, right and bottom
chess.svg.board(board, inside_coordinates=True, inside_coord_style=2)

r2

chess.com board simulation

colors = {
    'square light': '#EBECD0',
    'square dark': '#739552',
}
chess.svg.board(board, inside_coordinates=True, colors=colors)

r3

The following params are added for svg.board function:

  • inside_coordinates: Pass True to 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.

close #1145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible to Support Rendering Coordinates Inside the Chessboard?
1 participant