MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / get_color_mapping

Function get_color_mapping

src/hyperagent/utils.py:481–489  ·  view source on GitHub ↗

Get mapping for items to a support color.

(
    items: List[str], excluded_colors: Optional[List] = None
)

Source from the content-addressed store, hash-verified

479
480
481def get_color_mapping(
482 items: List[str], excluded_colors: Optional[List] = None
483) -> Dict[str, str]:
484 """Get mapping for items to a support color."""
485 colors = list(_TEXT_COLOR_MAPPING.keys())
486 if excluded_colors is not None:
487 colors = [c for c in colors if c not in excluded_colors]
488 color_mapping = {item: colors[i % len(colors)] for i, item in enumerate(items)}
489 return color_mapping
490
491
492def get_colored_text(text: str, color: str) -> str:

Callers

nothing calls this directly

Calls 2

listFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected