{"record":{"id":"b66d0ad51f4222d4","repo":"langchain-ai/langchain","slug":"no-colors-available-after-applying-exclusions","errorCode":null,"errorMessage":"No colors available after applying exclusions.","messagePattern":"No colors available after applying exclusions\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/core/langchain_core/utils/input.py","lineNumber":34,"sourceCode":") -> dict[str, str]:\n    \"\"\"Get mapping for items to a support color.\n\n    Args:\n        items: The items to map to colors.\n        excluded_colors: The colors to exclude.\n\n    Returns:\n        The mapping of items to colors.\n\n    Raises:\n        ValueError: If no colors are available after applying exclusions.\n    \"\"\"\n    colors = list(_TEXT_COLOR_MAPPING.keys())\n    if excluded_colors is not None:\n        colors = [c for c in colors if c not in excluded_colors]\n    if not colors:\n        msg = \"No colors available after applying exclusions.\"\n        raise ValueError(msg)\n    return {item: colors[i % len(colors)] for i, item in enumerate(items)}\n\n\ndef get_colored_text(text: str, color: str) -> str:\n    \"\"\"Get colored text.\n\n    Args:\n        text: The text to color.\n        color: The color to use.\n\n    Returns:\n        The colored text.\n    \"\"\"\n    color_str = _TEXT_COLOR_MAPPING[color]\n    return f\"\\u001b[{color_str}m\\033[1;3m{text}\\u001b[0m\"\n\n\ndef get_bolded_text(text: str) -> str:","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/langchain-ai/langchain/blob/e32fa9a52eab3b61ad7a45399bfde59b3e580fc4/libs/core/langchain_core/utils/input.py#L16-L52","documentation":"Error \"No colors available after applying exclusions.\" thrown in langchain-ai/langchain.","triggerScenarios":"Raised when get_color_mapping is asked for colors but the set of available colors is entirely removed by the excluded_colors set.","commonSituations":"See trigger scenarios.","solutions":["Reduce the exclude_colors list so at least one color remains available.","Remove the exclusions entirely to use the full default color set."],"exampleFix":"get_color_mapping(items, excluded_colors=[c for c in excluded if c != 'red'])","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e32fa9a52eab3b61ad7a45399bfde59b3e580fc4","analyzedAt":"2026-08-14T18:42:09.092Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}