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

Function textStyleToSpanProps

src/ink/Ansi.tsx:158–171  ·  view source on GitHub ↗

* Convert termio's TextStyle to SpanProps.

(style: TextStyle)

Source from the content-addressed store, hash-verified

156 * Convert termio's TextStyle to SpanProps.
157 */
158function textStyleToSpanProps(style: TextStyle): SpanProps {
159 const props: SpanProps = {};
160 if (style.bold) props.bold = true;
161 if (style.dim) props.dim = true;
162 if (style.italic) props.italic = true;
163 if (style.underline !== 'none') props.underline = true;
164 if (style.strikethrough) props.strikethrough = true;
165 if (style.inverse) props.inverse = true;
166 const fgColor = colorToString(style.fg);
167 if (fgColor) props.color = fgColor;
168 const bgColor = colorToString(style.bg);
169 if (bgColor) props.backgroundColor = bgColor;
170 return props;
171}
172
173// Map termio named colors to the ansi: format
174const NAMED_COLOR_MAP: Record<NamedColor, string> = {

Callers 1

parseToSpansFunction · 0.85

Calls 1

colorToStringFunction · 0.85

Tested by

no test coverage detected