MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / get_button_colors

Function get_button_colors

gui/styles.py:35–79  ·  view source on GitHub ↗

Get color configuration for CTkButton based on style. Args: style: One of "default", "success", "danger", "accent", "outline" Returns: Dictionary of color parameters for CTkButton

(style: str = "default")

Source from the content-addressed store, hash-verified

33
34
35def get_button_colors(style: str = "default") -> dict:
36 """
37 Get color configuration for CTkButton based on style.
38
39 Args:
40 style: One of "default", "success", "danger", "accent", "outline"
41
42 Returns:
43 Dictionary of color parameters for CTkButton
44 """
45 styles = {
46 "default": {
47 "fg_color": COLORS["bg_light"],
48 "hover_color": COLORS["border_light"],
49 "text_color": COLORS["text_primary"],
50 },
51 "success": {
52 "fg_color": COLORS["success"],
53 "hover_color": COLORS["success_hover"],
54 "text_color": COLORS["text_on_color"], # Always white for contrast
55 },
56 "danger": {
57 "fg_color": COLORS["error"],
58 "hover_color": COLORS["error_hover"],
59 "text_color": COLORS["text_on_color"], # Always white for contrast
60 },
61 "accent": {
62 "fg_color": COLORS["accent"],
63 "hover_color": COLORS["accent_hover"],
64 "text_color": COLORS["text_on_color"], # Always white for contrast
65 },
66 "outline": {
67 "fg_color": "transparent",
68 "hover_color": COLORS["bg_light"],
69 "text_color": COLORS["text_primary"],
70 "border_width": DIMENSIONS["border_width"],
71 "border_color": COLORS["accent"],
72 },
73 "ghost": {
74 "fg_color": "transparent",
75 "hover_color": COLORS["bg_medium"],
76 "text_color": COLORS["text_secondary"],
77 },
78 }
79 return styles.get(style, styles["default"])
80
81
82def get_entry_style() -> dict:

Calls 1

getMethod · 0.45