* Convert termio's Color to the string format used by Ink.
(color: TermioColor)
| 194 | * Convert termio's Color to the string format used by Ink. |
| 195 | */ |
| 196 | function 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. |
no outgoing calls
no test coverage detected