maaslalani / gambit

Play chess in your terminal
MIT License
825 stars 30 forks source link

Support for squares background colors and themes #13

Open Rocche opened 1 year ago

Rocche commented 1 year ago

Attempt to contribute to solve issue #11. The command supports a -t or --theme flag which specifies the path to a theme file. The command to run is:

go run . -t <path_to_theme_file>

If the application is built:

./gambit -t <path_to_theme_file>

In case a theme file is not provided, the board will be rendered as always without square colors.

A theme file has the following format:

WHITE=<color_of_white_pieces>
BLACK=<color_of_black_pieces>
LIGHTSQUARE=<color_of_light_squares>
DARKSQUARE=<color_of_dark_squares>
AVAILABLEMOVES=<color_of_available_move_dots>
SELECTEDPIECE=<color_of_selected_piece>
CHECK=<color_of_king_in_check>

There are two example files in the themes folder. You can find the relative screenshots below.

No theme Classic theme Ice theme
no_theme classic ice
maaslalani commented 1 year ago

Wow! This is quite awesome! Thank you so much! I'll take a look at this but great work, most likely the theme file format will change but everything looks quite good

MaxWasTakenYT commented 1 month ago

Merge when? It's been a whole year :*)