Resolve color configuration with fallbacks to defaults. Args: title_text_color: Title text color from config title_fill_color: Title fill color from config main_text_color: Main text color from config main_text_fill_color: Main text fill color from config
(
title_text_color: Optional[tuple],
title_fill_color: Optional[tuple],
main_text_color: Optional[tuple],
main_text_fill_color: Optional[tuple]
)
| 58 | |
| 59 | |
| 60 | def resolve_colors( |
| 61 | title_text_color: Optional[tuple], |
| 62 | title_fill_color: Optional[tuple], |
| 63 | main_text_color: Optional[tuple], |
| 64 | main_text_fill_color: Optional[tuple] |
| 65 | ) -> tuple: |
| 66 | """ |
| 67 | Resolve color configuration with fallbacks to defaults. |
| 68 | |
| 69 | Args: |
| 70 | title_text_color: Title text color from config |
| 71 | title_fill_color: Title fill color from config |
| 72 | main_text_color: Main text color from config |
| 73 | main_text_fill_color: Main text fill color from config |
| 74 | |
| 75 | Returns: |
| 76 | Tuple of (title_text, title_fill, main_text, main_text_fill) |
| 77 | """ |
| 78 | final_title_text = title_text_color if title_text_color is not None else DEFAULT_TITLE_TEXT_COLOR |
| 79 | final_title_fill = title_fill_color if title_fill_color is not None else DEFAULT_TITLE_FILL_COLOR |
| 80 | final_main_text = main_text_color |
| 81 | final_main_fill = main_text_fill_color |
| 82 | |
| 83 | return final_title_text, final_title_fill, final_main_text, final_main_fill |