MCPcopy Index your code
hub / github.com/codeaashu/claude-code / colorToString

Function colorToString

src/ink/Ansi.tsx:196–207  ·  view source on GitHub ↗

* Convert termio's Color to the string format used by Ink.

(color: TermioColor)

Source from the content-addressed store, hash-verified

194 * Convert termio's Color to the string format used by Ink.
195 */
196function colorToString(color: TermioColor): Color | undefined {
197 switch (color.type) {
198 case 'named':
199 return NAMED_COLOR_MAP[color.name] as Color;
200 case 'indexed':
201 return `ansi256(${color.index})` as Color;
202 case 'rgb':
203 return `rgb(${color.r},${color.g},${color.b})` as Color;
204 case 'default':
205 return undefined;
206 }
207}
208
209/**
210 * Check if two SpanProps are equal for merging.

Callers 1

textStyleToSpanPropsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected