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

Function _color_ratio

src/semble/stats.py:159–162  ·  view source on GitHub ↗

Color a savings percentage according to its value.

(pct: int, enabled: bool)

Source from the content-addressed store, hash-verified

157
158
159def _color_ratio(pct: int, enabled: bool) -> str:
160 """Color a savings percentage according to its value."""
161 code = "32" if pct >= 80 else "33" if pct >= 50 else "31"
162 return _color(code, f"{pct}%", enabled)
163
164
165def format_savings_report(path: Path | None = None) -> str:

Callers 1

format_savings_reportFunction · 0.85

Calls 1

_colorFunction · 0.85

Tested by

no test coverage detected