(color: string | undefined)
| 13 | * Falls back to the raw ANSI color if the color is not a known agent color. |
| 14 | */ |
| 15 | export function toInkColor(color: string | undefined): TextProps['color'] { |
| 16 | if (!color) { |
| 17 | return DEFAULT_AGENT_THEME_COLOR |
| 18 | } |
| 19 | // Try to map to a theme color if it's a known agent color |
| 20 | const themeColor = AGENT_COLOR_TO_THEME_COLOR[color as AgentColorName] |
| 21 | if (themeColor) { |
| 22 | return themeColor |
| 23 | } |
| 24 | // Fall back to raw ANSI color for unknown colors |
| 25 | return `ansi:${color}` as TextProps['color'] |
| 26 | } |
| 27 |
no outgoing calls
no test coverage detected