ankigammon 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ankigammon might be problematic. Click here for more details.

Files changed (56) hide show
  1. ankigammon/__init__.py +7 -0
  2. ankigammon/__main__.py +6 -0
  3. ankigammon/analysis/__init__.py +13 -0
  4. ankigammon/analysis/score_matrix.py +373 -0
  5. ankigammon/anki/__init__.py +6 -0
  6. ankigammon/anki/ankiconnect.py +224 -0
  7. ankigammon/anki/apkg_exporter.py +123 -0
  8. ankigammon/anki/card_generator.py +1307 -0
  9. ankigammon/anki/card_styles.py +1034 -0
  10. ankigammon/gui/__init__.py +8 -0
  11. ankigammon/gui/app.py +209 -0
  12. ankigammon/gui/dialogs/__init__.py +10 -0
  13. ankigammon/gui/dialogs/export_dialog.py +597 -0
  14. ankigammon/gui/dialogs/import_options_dialog.py +163 -0
  15. ankigammon/gui/dialogs/input_dialog.py +776 -0
  16. ankigammon/gui/dialogs/note_dialog.py +93 -0
  17. ankigammon/gui/dialogs/settings_dialog.py +384 -0
  18. ankigammon/gui/format_detector.py +292 -0
  19. ankigammon/gui/main_window.py +1071 -0
  20. ankigammon/gui/resources/icon.icns +0 -0
  21. ankigammon/gui/resources/icon.ico +0 -0
  22. ankigammon/gui/resources/icon.png +0 -0
  23. ankigammon/gui/resources/style.qss +394 -0
  24. ankigammon/gui/resources.py +26 -0
  25. ankigammon/gui/widgets/__init__.py +8 -0
  26. ankigammon/gui/widgets/position_list.py +193 -0
  27. ankigammon/gui/widgets/smart_input.py +268 -0
  28. ankigammon/models.py +322 -0
  29. ankigammon/parsers/__init__.py +7 -0
  30. ankigammon/parsers/gnubg_parser.py +454 -0
  31. ankigammon/parsers/xg_binary_parser.py +870 -0
  32. ankigammon/parsers/xg_text_parser.py +729 -0
  33. ankigammon/renderer/__init__.py +5 -0
  34. ankigammon/renderer/animation_controller.py +406 -0
  35. ankigammon/renderer/animation_helper.py +221 -0
  36. ankigammon/renderer/color_schemes.py +145 -0
  37. ankigammon/renderer/svg_board_renderer.py +824 -0
  38. ankigammon/settings.py +239 -0
  39. ankigammon/thirdparty/__init__.py +7 -0
  40. ankigammon/thirdparty/xgdatatools/__init__.py +17 -0
  41. ankigammon/thirdparty/xgdatatools/xgimport.py +160 -0
  42. ankigammon/thirdparty/xgdatatools/xgstruct.py +1032 -0
  43. ankigammon/thirdparty/xgdatatools/xgutils.py +118 -0
  44. ankigammon/thirdparty/xgdatatools/xgzarc.py +260 -0
  45. ankigammon/utils/__init__.py +13 -0
  46. ankigammon/utils/gnubg_analyzer.py +431 -0
  47. ankigammon/utils/gnuid.py +622 -0
  48. ankigammon/utils/move_parser.py +239 -0
  49. ankigammon/utils/ogid.py +335 -0
  50. ankigammon/utils/xgid.py +419 -0
  51. ankigammon-1.0.0.dist-info/METADATA +370 -0
  52. ankigammon-1.0.0.dist-info/RECORD +56 -0
  53. ankigammon-1.0.0.dist-info/WHEEL +5 -0
  54. ankigammon-1.0.0.dist-info/entry_points.txt +2 -0
  55. ankigammon-1.0.0.dist-info/licenses/LICENSE +21 -0
  56. ankigammon-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,145 @@
1
+ """Color schemes for backgammon board rendering."""
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Dict
5
+
6
+
7
+ @dataclass
8
+ class ColorScheme:
9
+ """Defines colors for a backgammon board theme."""
10
+ name: str
11
+ board_light: str # Light board background
12
+ board_dark: str # Dark board borders
13
+ point_light: str # Light triangle points
14
+ point_dark: str # Dark triangle points
15
+ checker_x: str # X player checkers (white/top)
16
+ checker_o: str # O player checkers (black/bottom)
17
+ checker_border: str # Checker borders
18
+ bar: str # Bar (center divider)
19
+ text: str # Text color
20
+ bearoff: str # Bear-off tray background
21
+ dice_color: str # Dice color (usually matches pale checker)
22
+
23
+
24
+ # Define 5 beautiful color schemes
25
+ CLASSIC = ColorScheme(
26
+ name="Classic",
27
+ board_light="#DEB887", # Burlywood
28
+ board_dark="#8B4513", # SaddleBrown
29
+ point_light="#F5DEB3", # Wheat
30
+ point_dark="#8B4513", # SaddleBrown
31
+ checker_x="#000000", # Black
32
+ checker_o="#FFFFFF", # White
33
+ checker_border="#333333", # Dark gray
34
+ bar="#654321", # Dark brown
35
+ text="#000000", # Black
36
+ bearoff="#DEB887", # Burlywood
37
+ dice_color="#FFFFFF" # White (matches pale checker)
38
+ )
39
+
40
+ FOREST = ColorScheme(
41
+ name="Forest",
42
+ board_light="#A8C5A0", # Muted sage green
43
+ board_dark="#3D5A3D", # Deep forest green
44
+ point_light="#C9D9C4", # Soft mint
45
+ point_dark="#5F7A5F", # Muted olive green
46
+ checker_x="#6B4423", # Warm brown
47
+ checker_o="#F5F5DC", # Beige (off-white)
48
+ checker_border="#3D5A3D", # Deep forest green
49
+ bar="#4A6147", # Muted forest green
50
+ text="#000000", # Black
51
+ bearoff="#A8C5A0", # Muted sage green
52
+ dice_color="#F5F5DC" # Beige (matches pale checker)
53
+ )
54
+
55
+ OCEAN = ColorScheme(
56
+ name="Ocean",
57
+ board_light="#87CEEB", # SkyBlue
58
+ board_dark="#191970", # MidnightBlue
59
+ point_light="#B0E0E6", # PowderBlue
60
+ point_dark="#4682B4", # SteelBlue
61
+ checker_x="#8B0000", # DarkRed
62
+ checker_o="#FFFACD", # LemonChiffon (light)
63
+ checker_border="#191970", # MidnightBlue
64
+ bar="#1E3A5F", # Deep ocean blue
65
+ text="#000000", # Black
66
+ bearoff="#87CEEB", # SkyBlue
67
+ dice_color="#FFFACD" # LemonChiffon (matches pale checker)
68
+ )
69
+
70
+ DESERT = ColorScheme(
71
+ name="Desert",
72
+ board_light="#D4A574", # Muted tan/sand
73
+ board_dark="#8B6F47", # Warm brown
74
+ point_light="#E8C9A0", # Soft beige
75
+ point_dark="#B8956A", # Dusty tan
76
+ checker_x="#6B4E71", # Muted purple
77
+ checker_o="#FFF8DC", # Cornsilk (cream)
78
+ checker_border="#6B4E71", # Muted purple
79
+ bar="#9B7653", # Warm brown
80
+ text="#000000", # Black
81
+ bearoff="#D4A574", # Muted tan/sand
82
+ dice_color="#FFF8DC" # Cornsilk (matches pale checker)
83
+ )
84
+
85
+ SUNSET = ColorScheme(
86
+ name="Sunset",
87
+ board_light="#D4825A", # Terracotta/burnt orange
88
+ board_dark="#5C3317", # Dark chocolate brown
89
+ point_light="#E69B7B", # Soft coral
90
+ point_dark="#B8552F", # Deep burnt orange
91
+ checker_x="#4A1E1E", # Deep burgundy
92
+ checker_o="#FFF5E6", # Warm white
93
+ checker_border="#5C3317", # Dark chocolate brown
94
+ bar="#8B4726", # Russet brown
95
+ text="#000000", # Black
96
+ bearoff="#D4825A", # Terracotta/burnt orange
97
+ dice_color="#FFF5E6" # Warm white (matches pale checker)
98
+ )
99
+
100
+ MIDNIGHT = ColorScheme(
101
+ name="Midnight",
102
+ board_light="#2F4F4F", # DarkSlateGray
103
+ board_dark="#000000", # Black
104
+ point_light="#708090", # SlateGray
105
+ point_dark="#1C1C1C", # Nearly black
106
+ checker_x="#DC143C", # Crimson (red)
107
+ checker_o="#E6E6FA", # Lavender (light)
108
+ checker_border="#000000", # Black
109
+ bar="#0F0F0F", # Very dark gray
110
+ text="#FFFFFF", # White (for contrast)
111
+ bearoff="#2F4F4F", # DarkSlateGray
112
+ dice_color="#E6E6FA" # Lavender (matches pale checker)
113
+ )
114
+
115
+
116
+ # Dictionary of all available schemes
117
+ SCHEMES: Dict[str, ColorScheme] = {
118
+ "classic": CLASSIC,
119
+ "forest": FOREST,
120
+ "ocean": OCEAN,
121
+ "desert": DESERT,
122
+ "sunset": SUNSET,
123
+ "midnight": MIDNIGHT,
124
+ }
125
+
126
+
127
+ def get_scheme(name: str) -> ColorScheme:
128
+ """
129
+ Get a color scheme by name.
130
+
131
+ Args:
132
+ name: Scheme name (case-insensitive)
133
+
134
+ Returns:
135
+ ColorScheme object
136
+
137
+ Raises:
138
+ KeyError: If scheme name not found
139
+ """
140
+ return SCHEMES[name.lower()]
141
+
142
+
143
+ def list_schemes() -> list[str]:
144
+ """Get list of available scheme names."""
145
+ return list(SCHEMES.keys())