txlyre 1 day ago
parent
commit
b6983085a4
1 changed files with 3 additions and 0 deletions
  1. 3 0
      chess0.py

+ 3 - 0
chess0.py

@@ -123,6 +123,9 @@ class ChessManager:
         if not session:
             raise KeyError(id)
 
+        if session.board.is_check():
+            return chess.svg.board(session.board, fill={checker: "#cc0000cc" for checker in session.board.checkers()}, check=session.board.king(session.board.turn))
+
         return chess.svg.board(session.board)
 
     def ascii(self, id):