MCPcopy
hub / github.com/MinishLab/semble / _color

Function _color

src/semble/stats.py:29–31  ·  view source on GitHub ↗

Apply an ANSI color code when enabled.

(code: str, text: str, enabled: bool)

Source from the content-addressed store, hash-verified

27
28
29def _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

Callers 2

_color_ratioFunction · 0.85
format_savings_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected