Apply an ANSI color code when enabled.
(code: str, text: str, enabled: bool)
| 27 | |
| 28 | |
| 29 | def _color(code: str, text: str, enabled: bool) -> str: |
| 30 | """Apply an ANSI color code when enabled.""" |
| 31 | return f"\033[{code}m{text}\033[0m" if enabled else text |
| 32 | |
| 33 | |
| 34 | @dataclass |
no outgoing calls
no test coverage detected